1 /** 2 * Add Javascript - Node features JS 3 */ 4jQuery(document).ready(function($) { 5 if (jQuery("#affix").length>0) { 6 7 var affixBottom = $("#footer").outerHeight(true) 8 + $("#subfooter").outerHeight(true) 9 + $("#main-content").outerHeight(true) 10 - $(".block-system-main-block").outerHeight(true), 11 affixTop = $("#affix").offset().top; 12 13 //The admin overlay menu height 14 var headerHeight = $("#header").outerHeight(true); 15 var adminHeight = parseInt($('body').css('paddingTop')); 16 var topValue = adminHeight + headerHeight + 15; 17 18 //We select the highest of the 2 adminHeight OR fixedheaderHeight to use 19 if (headerHeight > adminHeight) { 20 fixedAffixTop = headerHeight; 21 } else { 22 fixedAffixTop = adminHeight; 23 } 24 25 function initializeAffix(topAffix) { 26 if ($(".fixed-header-enabled").length>0) { 27 affixBottom = affixBottom + headerHeight - fixedAffixTop - adminHeight + 15; 28 initAffixTop = topAffix - adminHeight - headerHeight - 15; //The fixedAffixTop is added as padding on the page so we need to remove it from affixTop 29 } else { 30 affixBottom = affixBottom; 31 initAffixTop = topAffix - adminHeight - 15; // The adminHeight is added as padding on the page so we need to remove it from affixTop 32 } 33 $("#affix").affix({ 34 offset: { 35 top: initAffixTop, 36 bottom: affixBottom 37 } 38 }); 39 } 40 41 //The internal banner element is rendered after it is ready so initially it does not have height that can calculated 42 //Therefore we manually add the height when we know it or we wait a few seconds to when its height is not known 43 initializeAffix(affixTop); 44 45 $("#affix").on("affixed.bs.affix", function () { 46 //We set through JS the inline style top position 47 if ($(".fixed-header-enabled").length>0) { 48 $("#affix").css("top", (headerHeight+adminHeight)+"px"); 49 } else { 50 $("#affix").css("top", (adminHeight)+"px"); 51 } 52 }); 53 54 } 55}); 56
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.