1$.fn.outerFind = function(selector) { 2 return this.find(selector).addBack(selector); 3}; 4function initTabs(target) { 5 if ($(target).find('.nav-tabs').length !== 0) { 6 $(target).outerFind('section[id^="tabs"]').each(function() { 7 var componentID = $(this).attr('id'); 8 var $tabsNavItem = $(this).find('.nav-tabs .nav-item'); 9 var $tabPane = $(this).find('.tab-pane'); 10 11 $tabPane.removeClass('active').eq(0).addClass('active'); 12 13 $tabsNavItem.find('a').removeClass('active').removeAttr('aria-expanded') 14 .eq(0).addClass('active'); 15 16 $tabPane.each(function() { 17 $(this).attr('id', componentID + '_tab' + $(this).index()); 18 }); 19 20 $tabsNavItem.each(function() { 21 $(this).find('a').attr('href', '#' + componentID + '_tab' + $(this).index()); 22 }); 23 }); 24 } 25} 26 27// Mobirise Initilizaton 28var isBuilder = $('html').hasClass('is-builder'); 29if (isBuilder) { 30 $(document).on('add.cards', function(e) { 31 initTabs(e.target); 32 }); 33} else { 34 if (typeof window.initTabsPlugin === 'undefined'){ 35 window.initTabsPlugin = true; 36 console.log('init tabs by plugin'); 37 initTabs(document.body); 38 } 39}
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.