src/tabs.js
// (optionally) hide others in group
(optionally) hide others in group
( optionally ) hide others in group
activateTabContent(hash, isSticky = false) {
    const $thisTab = $(hash);
    if (!isSticky) {
      if ($thisTab.is(':visible')) return;
      const tabsGroup = $thisTab.data('tabs-group');
      const $tabsGroup = this.$tabContents.filter(function() {
        return $(this).data('tabs-group') === tabsGroup;
      });
      for (let i = 0; i < $tabsGroup.length; i++) {
        this._defaultToggleContent($tabsGroup[i], false);
      }
      this._defaultToggleContent($thisTab, true);
    } else {
      if ($thisTab.is(':visible')) {
        this._defaultToggleContent($thisTab, false);
      } else {
        this._defaultToggleContent($thisTab, true);
      }
    }
  }
activateTabContent ( hash , isSticky = false ) { const $thisTab = $ ( hash ) ; if ( ! isSticky ) { if ( $thisTab . is ( ':visible' ) ) return ; const tabsGroup = $thisTab . data ( 'tabs-group' ) ; const $tabsGroup = this . $tabContents . filter ( function ( ) { return $ ( this ) . data ( 'tabs-group' ) === tabsGroup ; } ) ; for ( let i = 0 ; i < $tabsGroup . length ; i ++ ) { this . _defaultToggleContent ( $tabsGroup [ i ] , false ) ; } this . _defaultToggleContent ( $thisTab , true ) ; } else { if ( $thisTab . is ( ':visible' ) ) { this . _defaultToggleContent ( $thisTab , false ) ; } else { this . _defaultToggleContent ( $thisTab , true ) ; } } }
(optionally) hide others in group
( optionally ) hide others in group
// Locate other tabs that share the same 'tabs-group' // Disable other tabs in this group // Enable this tab content // Tabs are sticky, so we only toggle the individual item