2010/6/23 Nihiltres <wiki.nihiltres(a)gmail.com>om>:
I've been playing around with customizing Vector a
bit. I'm particularly enjoying the inclusion of jQuery; as a newbie to JS it makes
many things much easier than they might be otherwise. I've run into a problem that
I'm not sure how to work around, and it seems a general enough problem that I figured
I'd ask about it here; I hope it's on-topic enough. :P
If one adds a tab to the p-views tab bar, one gets a harmless but annoying
"$settings is undefined" error from plugins.combined.min.js (specifically, the
Collapsible Tabs code). If the window is resized in such a way that tabs should not
collapse, and the new tab does not have the "collapsible" class, the error
repeats. If the window is then resized such that one or more tabs are collapsed, nothing
new happens; the new tab will be collapsed iff it has the "collapsible" class.
If the window is further resized so as to allow the collapsed tabs to uncollapse, the
error repeats indefinitely. This is very frustrating for people who want to customize
Vector.
As far as I can tell (again, JS newbie), the collapsibleTabs JS assigns some sort of data
to each element, settings data that lets the rest of the code put things back into place
nicely when it's done. How can I (assuming I can) assign this data to tabs to be added
to the p-views tab bar or otherwise avoid* this error? (*No, simply putting/leaving things
in p-cactions defeats the purpose.)
Placing extra tabs in the tab bar can be very convenient—for example, one of my scripts
moves the "delete" tab out if there's an element on the page which uses one
of the classes used by enwiki's deletion templates—but the errors are quire
undesirable. Thanks for any help you can provide, and I'll be sure to either write up
my solution, or point others to existing documentation in future, if you can point out the
gist of it for me.
I think calling $j.collapsibleTabs.handleResize(); yourself should do
it. Either way, this is a bug in CollapsibleTabs and should be fixed.
Roan Kattouw (Catrope)