Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Currently the tab items contain the class horizontal-tab-button+i however it is not easy to retrieve the numeric key (i) of the currently selected tab. Therefor it is useful we we have an attribute for this - horizontal-tab-button="i".
Proposed resolution
Add the attribute horizontal-tab-button to each tab item.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#8 | 2848008-8.patch | 502 bytes | kfritsche |
#7 | 2848008-7.patch | 497 bytes | graceman9 |
#2 | 2848008-2.patch | 499 bytes | hchonov |
Comments
Comment #2
hchonovComment #3
kay_v CreditAttribution: kay_v as a volunteer commentedthis patch applies cleanly and resolves the stated issue when applied to field_group-8.x-3.x-dev
I'm switching the issue version to the above since the current core version (Drupal 8.4) requires it per the module project page:
Comment #4
kay_v CreditAttribution: kay_v as a volunteer commentedComment #5
kay_v CreditAttribution: kay_v as a volunteer commentedComment #6
geek-merlinThis sounds useful. Please add a data- prefix to the attribute to get valid html.
https://stackoverflow.com/a/31810008/606859
Comment #7
graceman9 CreditAttribution: graceman9 at Internetdevels, Drupal Ukraine Community for Internetdevels commentedDoes anyone still need this?
Comment #8
kfritscheWe still use this, but with a slight different version.
We use "attr('data-horizontalTabButton', i)" instead of data, because this is also used in our testing (behat + browsertest) and jqueries data doesn't serialize this back as an attribute to the DOM.
Comment #10
nils.destoop CreditAttribution: nils.destoop as a volunteer and at iO commentedThx for the patch. I committed it to dev