You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

2 lines
6.3 KiB

define ("theme_ilb/bootstrap/scrollspy",["exports","jquery","./util"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=d(b);c=d(c);function d(a){return a&&a.__esModule?a:{default:a}}function e(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){e=function(a){return typeof a}}else{e=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return e(a)}function f(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function g(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){f(Object(c),!0).forEach(function(b){h(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{f(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function h(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function i(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function j(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function k(a,b,c){if(b)j(a.prototype,b);if(c)j(a,c);return a}var l="bs.scrollspy",m=".".concat(l),n=b.default.fn.scrollspy,o={offset:10,method:"auto",target:""},p={offset:"number",method:"string",target:"(string|element)"},q="activate".concat(m),r="scroll".concat(m),s="load".concat(m).concat(".data-api"),t="active",u=".nav, .list-group",v=".nav-link",w=".list-group-item",x="position",y=function(){function a(c,d){var e=this;i(this,a);this._element=c;this._scrollElement="BODY"===c.tagName?window:c;this._config=this._getConfig(d);this._selector="".concat(this._config.target," ").concat(v,",")+"".concat(this._config.target," ").concat(w,",")+"".concat(this._config.target," ").concat(".dropdown-item");this._offsets=[];this._targets=[];this._activeTarget=null;this._scrollHeight=0;(0,b.default)(this._scrollElement).on(r,function(a){return e._process(a)});this.refresh();this._process()}k(a,[{key:"refresh",value:function refresh(){var a=this,d=this._scrollElement===this._scrollElement.window?"offset":x,e="auto"===this._config.method?d:this._config.method,f=e===x?this._getScrollTop():0;this._offsets=[];this._targets=[];this._scrollHeight=this._getScrollHeight();var g=[].slice.call(document.querySelectorAll(this._selector));g.map(function(a){var d,g=c.default.getSelectorFromElement(a);if(g){d=document.querySelector(g)}if(d){var h=d.getBoundingClientRect();if(h.width||h.height){return[(0,b.default)(d)[e]().top+f,g]}}return null}).filter(function(a){return a}).sort(function(c,a){return c[0]-a[0]}).forEach(function(b){a._offsets.push(b[0]);a._targets.push(b[1])})}},{key:"dispose",value:function dispose(){b.default.removeData(this._element,l);(0,b.default)(this._scrollElement).off(m);this._element=null;this._scrollElement=null;this._config=null;this._selector=null;this._offsets=null;this._targets=null;this._activeTarget=null;this._scrollHeight=null}},{key:"_getConfig",value:function _getConfig(a){a=g({},o,{},"object"===e(a)&&a?a:{});if("string"!=typeof a.target&&c.default.isElement(a.target)){var d=(0,b.default)(a.target).attr("id");if(!d){d=c.default.getUID("scrollspy");(0,b.default)(a.target).attr("id",d)}a.target="#".concat(d)}c.default.typeCheckConfig("scrollspy",a,p);return a}},{key:"_getScrollTop",value:function _getScrollTop(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop}},{key:"_getScrollHeight",value:function _getScrollHeight(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}},{key:"_getOffsetHeight",value:function _getOffsetHeight(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height}},{key:"_process",value:function _process(){var a=this._getScrollTop()+this._config.offset,b=this._getScrollHeight(),c=this._config.offset+b-this._getOffsetHeight();if(this._scrollHeight!==b){this.refresh()}if(a>=c){var d=this._targets[this._targets.length-1];if(this._activeTarget!==d){this._activate(d)}return}if(this._activeTarget&&a<this._offsets[0]&&0<this._offsets[0]){this._activeTarget=null;this._clear();return}for(var e=this._offsets.length,f;e--;){f=this._activeTarget!==this._targets[e]&&a>=this._offsets[e]&&("undefined"==typeof this._offsets[e+1]||a<this._offsets[e+1]);if(f){this._activate(this._targets[e])}}}},{key:"_activate",value:function _activate(a){this._activeTarget=a;this._clear();var c=this._selector.split(",").map(function(b){return"".concat(b,"[data-target=\"").concat(a,"\"],").concat(b,"[href=\"").concat(a,"\"]")}),d=(0,b.default)([].slice.call(document.querySelectorAll(c.join(","))));if(d.hasClass("dropdown-item")){d.closest(".dropdown").find(".dropdown-toggle").addClass(t);d.addClass(t)}else{d.addClass(t);d.parents(u).prev("".concat(v,", ").concat(w)).addClass(t);d.parents(u).prev(".nav-item").children(v).addClass(t)}(0,b.default)(this._scrollElement).trigger(q,{relatedTarget:a})}},{key:"_clear",value:function _clear(){[].slice.call(document.querySelectorAll(this._selector)).filter(function(a){return a.classList.contains(t)}).forEach(function(a){return a.classList.remove(t)})}}],[{key:"_jQueryInterface",value:function _jQueryInterface(c){return this.each(function(){var d=(0,b.default)(this).data(l),f="object"===e(c)&&c;if(!d){d=new a(this,f);(0,b.default)(this).data(l,d)}if("string"==typeof c){if("undefined"==typeof d[c]){throw new TypeError("No method named \"".concat(c,"\""))}d[c]()}})}},{key:"VERSION",get:function get(){return"4.6.0"}},{key:"Default",get:function get(){return o}}]);return a}();(0,b.default)(window).on(s,function(){for(var a=[].slice.call(document.querySelectorAll("[data-spy=\"scroll\"]")),c=a.length,d=c,e;d--;){e=(0,b.default)(a[d]);y._jQueryInterface.call(e,e.data())}});b.default.fn.scrollspy=y._jQueryInterface;b.default.fn.scrollspy.Constructor=y;b.default.fn.scrollspy.noConflict=function(){b.default.fn.scrollspy=n;return y._jQueryInterface};a.default=y;return a.default});
//# sourceMappingURL=scrollspy.min.js.map