1! function(i) { 2 i.fn.theiaStickySidebar = function(t) { 3 var o = { 4 containerSelector: "", 5 additionalMarginTop: 0, 6 additionalMarginBottom: 0, 7 updateSidebarHeight: !0, 8 minWidth: 0 9 }; 10 t = i.extend(o, t), t.additionalMarginTop = parseInt(t.additionalMarginTop) || 0, t.additionalMarginBottom = parseInt(t.additionalMarginBottom) || 0, i("head").append(i('<style>.theiaStickySidebar:after {content: ""; display: table; clear: both;}</style>')), this.each(function() { 11 function o() { 12 e.fixedScrollTop = 0, e.sidebar.css({ 13 "min-height": "1px" 14 }), e.stickySidebar.css({ 15 position: "static", 16 width: "" 17 }) 18 } 19 20 function a(t) { 21 var o = t.height(); 22 return t.children().each(function() { 23 o = Math.max(o, i(this).height()) 24 }), o 25 } 26 var e = {}; 27 e.sidebar = i(this), e.options = t || {}, e.container = i(e.options.containerSelector), 0 == e.container.size() && (e.container = e.sidebar.parent()), e.sidebar.parents().css("-webkit-transform", "none"), e.sidebar.css({ 28 position: "relative", 29 overflow: "visible", 30 "-webkit-box-sizing": "border-box", 31 "-moz-box-sizing": "border-box", 32 "box-sizing": "border-box" 33 }), e.stickySidebar = e.sidebar.find(".theiaStickySidebar"), 0 == e.stickySidebar.length && (e.sidebar.find("script").remove(), e.stickySidebar = i("<div>").addClass("theiaStickySidebar").append(e.sidebar.children()), e.sidebar.append(e.stickySidebar)), e.marginTop = parseInt(e.sidebar.css("margin-top")), e.marginBottom = parseInt(e.sidebar.css("margin-bottom")), e.paddingTop = parseInt(e.sidebar.css("padding-top")), e.paddingBottom = parseInt(e.sidebar.css("padding-bottom")); 34 var d = e.stickySidebar.offset().top, 35 r = e.stickySidebar.outerHeight(); 36 e.stickySidebar.css("padding-top", 1), e.stickySidebar.css("padding-bottom", 1), d -= e.stickySidebar.offset().top, r = e.stickySidebar.outerHeight() - r - d, 0 == d ? (e.stickySidebar.css("padding-top", 0), e.stickySidebarPaddingTop = 0) : e.stickySidebarPaddingTop = 1, 0 == r ? (e.stickySidebar.css("padding-bottom", 0), e.stickySidebarPaddingBottom = 0) : e.stickySidebarPaddingBottom = 1, e.previousScrollTop = null, e.fixedScrollTop = 0, o(), e.onScroll = function(e) { 37 if (e.stickySidebar.is(":visible")) { 38 if (i("body").width() < e.options.minWidth) return void o(); 39 if (e.sidebar.outerWidth(!0) + 50 > e.container.width()) return void o(); 40 var d = i(document).scrollTop(), 41 r = "static"; 42 if (d >= e.container.offset().top + (e.paddingTop + e.marginTop - e.options.additionalMarginTop)) { 43 var n, s = e.paddingTop + e.marginTop + t.additionalMarginTop, 44 c = e.paddingBottom + e.marginBottom + t.additionalMarginBottom, 45 p = e.container.offset().top, 46 b = e.container.offset().top + a(e.container), 47 g = 0 + t.additionalMarginTop, 48 l = e.stickySidebar.outerHeight() + s + c < i(window).height(); 49 n = l ? g + e.stickySidebar.outerHeight() : i(window).height() - e.marginBottom - e.paddingBottom - t.additionalMarginBottom; 50 var f = p - d + e.paddingTop + e.marginTop, 51 S = b - d - e.paddingBottom - e.marginBottom, 52 h = e.stickySidebar.offset().top - d, 53 m = e.previousScrollTop - d; 54 "fixed" == e.stickySidebar.css("position") && (h += m), h = m > 0 ? Math.min(h, g) : Math.max(h, n - e.stickySidebar.outerHeight()), h = Math.max(h, f), h = Math.min(h, S - e.stickySidebar.outerHeight()); 55 var y = e.container.height() == e.stickySidebar.outerHeight(); 56 r = (y || h != g) && (y || h != n - e.stickySidebar.outerHeight()) ? d + h - e.sidebar.offset().top - e.paddingTop <= t.additionalMarginTop ? "static" : "absolute" : "fixed" 57 } 58 if ("fixed" == r) e.stickySidebar.css({ 59 position: "fixed", 60 width: e.sidebar.width(), 61 top: h, 62 left: e.sidebar.offset().left + parseInt(e.sidebar.css("padding-left")) 63 }); 64 else if ("absolute" == r) { 65 var k = {}; 66 "absolute" != e.stickySidebar.css("position") && (k.position = "absolute", k.top = d + h - e.sidebar.offset().top - e.stickySidebarPaddingTop
66- e.stickySidebarPaddingBottom), k.width = e.sidebar.width(), k.left = "", e.stickySidebar.css(k) 67 } else "static" == r && o(); 68 "static" != r && 1 == e.options.updateSidebarHeight && e.sidebar.css({ 69 "min-height": e.stickySidebar.outerHeight() + e.stickySidebar.offset().top - e.sidebar.offset().top + e.paddingBottom 70 }), e.previousScrollTop = d 71 } 72 }, e.onScroll(e), i(document).scroll(function(i) { 73 return function() { 74 i.onScroll(i) 75 } 76 }(e)), i(window).resize(function(i) { 77 return function() { 78 i.stickySidebar.css({ 79 position: "static" 80 }), i.onScroll(i) 81 } 82 }(e)) 83 }) 84 } 85}(jQuery);
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.