X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmisc%2Fvertical-tabs.js;h=18270073cbb65c5a05624efb720ae6b9e71db641;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=ea89e85030998d456dc4aab42a6a959cb85618ba;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;p=yaffs-website diff --git a/web/core/misc/vertical-tabs.js b/web/core/misc/vertical-tabs.js index ea89e8503..18270073c 100644 --- a/web/core/misc/vertical-tabs.js +++ b/web/core/misc/vertical-tabs.js @@ -26,42 +26,42 @@ $(context).find('[data-vertical-tabs-panes]').once('vertical-tabs').each(function () { var $this = $(this).addClass('vertical-tabs__panes'); var focusID = $this.find(':hidden.vertical-tabs__active-tab').val(); - var tab_focus = void 0; + var tabFocus = void 0; var $details = $this.find('> details'); if ($details.length === 0) { return; } - var tab_list = $(''); - $this.wrap('
').before(tab_list); + var tabList = $(''); + $this.wrap('
').before(tabList); $details.each(function () { var $that = $(this); - var vertical_tab = new Drupal.verticalTab({ + var verticalTab = new Drupal.verticalTab({ title: $that.find('> summary').text(), details: $that }); - tab_list.append(vertical_tab.item); - $that.removeClass('collapsed').attr('open', true).addClass('vertical-tabs__pane').data('verticalTab', vertical_tab); + tabList.append(verticalTab.item); + $that.removeClass('collapsed').attr('open', true).addClass('vertical-tabs__pane').data('verticalTab', verticalTab); if (this.id === focusID) { - tab_focus = $that; + tabFocus = $that; } }); - $(tab_list).find('> li').eq(0).addClass('first'); - $(tab_list).find('> li').eq(-1).addClass('last'); + $(tabList).find('> li').eq(0).addClass('first'); + $(tabList).find('> li').eq(-1).addClass('last'); - if (!tab_focus) { + if (!tabFocus) { var $locationHash = $this.find(window.location.hash); if (window.location.hash && $locationHash.length) { - tab_focus = $locationHash.closest('.vertical-tabs__pane'); + tabFocus = $locationHash.closest('.vertical-tabs__pane'); } else { - tab_focus = $this.find('> .vertical-tabs__pane').eq(0); + tabFocus = $this.find('> .vertical-tabs__pane').eq(0); } } - if (tab_focus.length) { - tab_focus.data('verticalTab').focus(); + if (tabFocus.length) { + tabFocus.data('verticalTab').focus(); } }); }