1define([ 2 'jquery' 3], function ($) { 4 'use strict'; 5 6 return function (tabsWidget) { 7 $.widget('springer.tabs', tabsWidget, { 8 options: { 9 animate: 500, 10 collapsible: true 11 }, 12 /** @inheritdoc */ 13 _instantiateCollapsible: function (element, index, active, disabled) { 14 var self = this; 15 this._super(element, index, active, disabled); 16 $(element).on('beforeOpen', function () { 17 self.setHashOnTabOpen(this); 18 }); 19 20 //For ticket SPRINGERNS01525 21 if ($("body").hasClass("catalog-product-view")) { 22 var hash = window.location.hash; 23 if (hash) { 24 var tabId = hash.substring(1); 25 var tabLink = document.querySelector('a[href="#' + tabId + '"]'); 26 if (tabLink) { 27 tabLink.click(); 28 } 29 } 30 } 31 }, 32 33 /** 34 * Set hash on tab open 35 * 36 * @param {HTMLElement} element 37 */ 38 setHashOnTabOpen: function (element) { 39 var trigger = $(element).find('[href^="#"]'); 40 if (trigger.length) { 41 window.history.replaceState(null, null, document.location.pathname + trigger.attr('href')) 42 } 43 } 44 }); 45 46 return $.springer.tabs; 47 }; 48});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.