PageSourceSearch

https://www.postindustriale.it/wp-content/themes/minimal-grid/asse…/theia-sticky-sidebar.min.js?ver=5.7.19

js postindustriale.it collected 2026-10-03 20:45:07 UTC 8,271 bytes, 126 lines download raw bytes

1!function (i) {
2    i.fn.theiaStickySidebar = function (t) {
3        function e(t, e) {
4            var a = o(t, e);
5            a || (console.log("TSS: Body width smaller than options.minWidth. Init is delayed."), i(document).on("scroll." + t.namespace, function (t, e) {
6                return function (a) {
7                    var n = o(t, e);
8                    n && i(this).unbind(a)
9                }
10            }(t, e)), i(window).on("resize." + t.namespace, function (t, e) {
11                return function (a) {
12                    var n = o(t, e);
13                    n && i(this).unbind(a)
14                }
15            }(t, e)))
16        }
17
18        function o(t, e) {
19            return t.initialized === !0 || !(i("body").width() < t.minWidth) && (a(t, e), !0)
20        }
21
22        function a(t, e) {
23            t.initialized = !0;
24            var o = i("#theia-sticky-sidebar-stylesheet-" + t.namespace);
25            0 === o.length && i("head").append(i('<style id="theia-sticky-sidebar-stylesheet-' + t.namespace + '">.theiaStickySidebar:after {content: ""; display: table; clear: both;}</style>')), e.each(function () {
26                function e() {
27                    a.fixedScrollTop = 0, a.sidebar.css({"min-height": "1px"}), a.stickySidebar.css({
28                        position: "static",
29                        width: "",
30                        transform: "none"
31                    })
32                }
33
34                function o(t) {
35                    var e = t.height();
36                    return t.children().each(function () {
37                        e = Math.max(e, i(this).height())
38                    }), e
39                }
40
41                var a = {};
42                if (a.sidebar = i(this), a.options = t || {}, a.container = i(a.options.containerSelector), 0 == a.container.length && (a.container = a.sidebar.parent()), a.sidebar.parents().css("-webkit-transform", "none"), a.sidebar.css({
43                        position: a.options.defaultPosition,
44                        overflow: "visible",
45                        "-webkit-box-sizing": "border-box",
46                        "-moz-box-sizing": "border-box",
47                        "box-sizing": "border-box"
48                    }), a.stickySidebar = a.sidebar.find(".theiaStickySidebar"), 0 == a.stickySidebar.length) {
49                    var s = /(?:text|application)\/(?:x-)?(?:javascript|ecmascript)/i;
50                    a.sidebar.find("script").filter(function (i, t) {
51                        return 0 === t.type.length || t.type.match(s)
52                    }).remove(), a.stickySidebar = i("<div>").addClass("theiaStickySidebar").append(a.sidebar.children()), a.sidebar.append(a.stickySidebar)
53                }
54                a.marginBottom = parseInt(a.sidebar.css("margin-bottom")), a.paddingTop = parseInt(a.sidebar.css("padding-top")), a.paddingBottom = parseInt(a.sidebar.css("padding-bottom"));
55                var r = a.stickySidebar.offset().top, d = a.stickySidebar.outerHeight();
56                a.stickySidebar.css("padding-top", 1), a.stickySidebar.css("padding-bottom", 1), r -= a.stickySidebar.offset().top, d = a.stickySidebar.outerHeight() - d - r, 0 == r ? (a.stickySidebar.css("padding-top", 0), a.stickySidebarPaddingTop = 0) : a.stickySidebarPaddingTop = 1, 0 == d ? (a.stickySidebar.css("padding-bottom", 0), a.stickySidebarPaddingBottom = 0) : a.stickySidebarPaddingBottom = 1, a.previousScrollTop = null, a.fixedScrollTop = 0, e(), a.onScroll = function (a) {
57                    if (a.stickySidebar.is(":visible")) {
58                        if (i("body").width() < a.options.minWidth)return void e();
59                        if (a.options.disableOnResponsiveLayouts) {
60                            var s = a.sidebar.outerWidth("none" == a.sidebar.css("float"));
61                            if (s + 50 > a.container.width())return void e()
62                        }
63                        var r = i(document).scrollTop(), d = "static";
64                        if (r >= a.sidebar.offset().top + (a.paddingTop - a.options.additionalMarginTop)) {
65                            var c, p = a.paddingTop + t.additionalMarginTop, b = a.paddingBottom + a.marginBottom + t.additionalMarginBottom, l = a.sidebar.offset().top, f = a.sidebar.offset().top + o(a.container), h = 0 + t.additionalMarginTop, g = a.stickySidebar.outerHeight() + p + b < i(window).height();
66                            c = g ? h + a.stickySidebar.outerHeight() : i(window).height() - a.marginBottom - a.paddingBottom - t.additionalMarginBottom;
67                            var u = l - r + a.paddingTop, S = f - r - a.paddingBottom - a.marginBottom, y = a.stickySidebar.offset().top - r, m = a.previousScrollTop - r;
68                            "fixed" == a.stickySidebar.css("position") && "modern" == a.options.sidebarBehavior && (y += m), "stick-to-top" == a.options.sidebarBehavior && (y = t.additionalMarginTop), "stick-to-bottom" == a.options.sidebarBehavior && (y = c - a.stickySidebar.outerHeight()), y = m > 0 ? Math.min(y, h) : Math.max(y, c - a.stickySidebar.outerHeight()), y = Math.max(y, u), y = Math.min(y, S - a.stickySidebar.outerHeight());
69                            var k = a.container.height() == a.stickySidebar.outerHeight();
70                            d = (k || y != h) && (k || y != c - a.stickySidebar.outerHeight()) ? r + y - a.sidebar.offset().top - a.paddingTop <= t.additionalMarginTop ? "static" : "absolute" : "fixed"
71                        }
72                        if ("fixed" == d) {
73                            var v = i(document).scrollLeft();
74                            a.stickySidebar.css({
75                                position: "fixed",
76                                width: n(a.stickySidebar) + "px",
77                                transform: "translateY(" + y + "px)",
78                                left: a.sidebar.offset().left + parseInt(a.sidebar.css("padding-left")) - v + "px",
79                                top: "0px"
80                            })
81                        } else if ("absolute" == d) {
82                            var x = {};
83                            "absolute" != a.stickySidebar.css("position") && (x.position = "absolute", x.transform = "translateY(" + (r + y - a.sidebar.offset().top - a.stickySidebarPaddingTop 
83- a.stickySidebarPaddingBottom) + "px)", x.top = "0px"), x.width = n(a.stickySidebar) + "px", x.left = "", a.stickySidebar.css(x)
84                        } else"static" == d && e();
85                        "static" != d && 1 == a.options.updateSidebarHeight && a.sidebar.css({"min-height": a.stickySidebar.outerHeight() + a.stickySidebar.offset().top - a.sidebar.offset().top + a.paddingBottom}), a.previousScrollTop = r
86                    }
87                }, a.onScroll(a), i(document).on("scroll." + a.options.namespace, function (i) {
88                    return function () {
89                        i.onScroll(i)
90                    }
91                }(a)), i(window).on("resize." + a.options.namespace, function (i) {
92                    return function () {
93                        i.stickySidebar.css({position: "static"}), i.onScroll(i)
94                    }
95                }(a)), "undefined" != typeof ResizeSensor && new ResizeSensor(a.stickySidebar[0], function (i) {
96                    return function () {
97                        i.onScroll(i)
98                    }
99                }(a))
100            })
101        }
102
103        function n(i) {
104            var t;
105            try {
106                t = i[0].getBoundingClientRect().width
107            } catch (i) {
108            }
109            return "undefined" == typeof t && (t = i.width()), t
110        }
111
112        var s = {
113            containerSelector: "",
114            additionalMarginTop: 0,
115            additionalMarginBottom: 0,
116            updateSidebarHeight: !0,
117            minWidth: 0,
118            disableOnResponsiveLayouts: !0,
119            sidebarBehavior: "modern",
120            defaultPosition: "relative",
121            namespace: "TSS"
122        };
123        return t = i.extend(s, t), t.additionalMarginTop = parseInt(t.additionalMarginTop) || 0, t.additionalMarginBottom = parseInt(t.additionalMarginBottom) || 0, e(t, this), this
124    }
125}(jQuery);
126//# sourceMappingURL=maps/theia-sticky-sidebar.min.js.map

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.