Hi,

While working with vertical tabs I noticed that there is a variable being set called 'weight', but I also noticed that this variable is not being referenced or respected by 'vertical_tabs.js'.

Attached is a patch to that both references and respects the tabs weight settings.
Admittedly I am no jQuery wizard, and the code could probably be optimized in a big way, it does currently work.

Cheers,
Deciphered.

Comments

deciphered’s picture

Status: Needs review » Needs work

Ok, while it does technically work, the sorting is not perfect.

It will consider 5 > 40 > 3.

quicksketch’s picture

As per #444378: Fields re-ordered by CCK do not have the right weight in Vertical Tabs, Vertical Tabs should already obey the order of the original fieldsets, so reordering them with JavaScript should not be necessary. If this isn't the case it's definitely unintended behavior.

deciphered’s picture

Hi Quicksketch,

The reason I wanted this functionality is that I am adding fieldsets/tabs to my vertical tabs field dynamically using an AHAH callback and the new fieldsets/tabs are ending up as the last items in the list.

I haven't whether adding the new fieldset in a weighted position will also solve this, so I will do that and report back.

Cheers,
Deciphered.

dww’s picture