Active
Project:
Magic Tabs
Version:
6.x-1.0
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
15 Nov 2008 at 05:42 UTC
Updated:
13 Feb 2012 at 03:50 UTC
I was attempting to use magic_tabs in combination with collapse.js. It worked fine on the initially loaded tab, but when the tab is switched to a new tab the collapse functionality is lost. From what I can tell this is because the tab change doesn't call Drupal.attachBehaviors. Is this something that magic_tabs should do or do I need to do this myself somehow?
Comments
Comment #1
esclapes commentedHaving the same problem with collapse.js and lightbox.js
Does anybody have more info about how to call the attachBehaviours function?
Comment #2
esclapes commentedI think I got it working... I had to dive a bit into unknown territory: http://drupal.org/node/114774#javascript-behaviors
I just added the attachBehaviors to the onclick event (I had to hack the module, which I did not want to, but don't know any other way):
Around line 140:
Comment #3
esclapes commentedUuups!
Just realized that this solution is not loading the section by ajax, but reloading the whole page... any better solution?
Comment #4
esclapes commentedOK! I think I got it now. I launch the attachBehaviors funtion as a callback functions (defined for the jquery command $.load)
Comment #5
jsobiecki commentedThank you. Your solution works for me too :)
Comment #6
WildKitten commentedThank you ciberligre! After hours and hours searching for solution, yours one worked like a charm!
Comment #7
Aleksey Zubko commentedThank you. Solution works for me too