Add classes to JS rewriting in horizontal tabs

Created on 16 January 2018, almost 7 years ago
Updated 8 September 2024, 4 months ago

I'm adding some classes to tabs in hook_field_group_re_render. I realise that whatever I add is completely ignored in the final ouput because the theming is rewritten in JS and replaced with hard-coded markup - e.g. formatters/tabs/horizontal-tabs.js

Drupal.theme.horizontalTab = function (settings) {
    var tab = {};
    var idAttr = settings.details.attr('id');

    tab.item = $('<li class="horizontal-tab-button" tabindex="-1"></li>')
      .append(tab.link = $('<a href="#' + idAttr + '"></a>')
        .append(tab.title = $('<strong></strong>').text(settings.title))
      );

Would it be an idea to support custom classes here? I can provide a patch for this which I think doesn't break anything and makes it more Drupal-like in terms of being able to customise output.

Feature request
Status

Fixed

Version

4.0

Component

Miscellaneous

Created by

miiimooo Europe

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024