You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was experimenting around with lazy loading tabs in a nested tab setup and discovered that for example "tabsactivate" (QTabs_ActivateEvent) gets executed for all child tabs, even if it was bound to the parent tab only.
Fix
Below is a fix that works, but not sure if it's the right way nor the right place to do this.
Please review and share your thoughts.
gets executed for all child tabs, even if it was bound to the parent tab only.
You have opened a big can of worms here. The problem is that the tabsactive event is bubbling up through the parent controls. The parent control is looking for the event, gets it from child controls, and so fires. It may be unexpected in this situation, but it is standard javascript behavior.
To change it could break code, and would be some effort. In other words, there are scenarios where someone wants this behavior. This is a much bigger issue than QTabs.
Possible fixes include:
Do nothing in the framework. You should set "event.target.id" as the Js Return Parameter of your action so that you can test what was clicked on and determine how to handle it.
Changing qcubed.js so that the target id of the control that was originally sent the event is always passed back to the event handler, so that you can test it.
Adding a parameter to QEvent that allows you to turn off bubbling. This would both make sure received bubbled events did not fire an event, and that any time an event fired off an ajax action, the event would no longer bubble to parent objects.
I think for now we leave this alone, and if it becomes a bigger issue we try one or a combination of the above.
Description
I was experimenting around with lazy loading tabs in a nested tab setup and discovered that for example "tabsactivate" (QTabs_ActivateEvent) gets executed for all child tabs, even if it was bound to the parent tab only.
Fix
Below is a fix that works, but not sure if it's the right way nor the right place to do this.
Please review and share your thoughts.
Simple test form + tmpl
nested_tab.php:
nested_tab.tpl.php:
The text was updated successfully, but these errors were encountered: