View file upload/js/themehouse/class/index.min.js

File size: 7.54Kb
(function(g){function e(a){if(h[a])return h[a].exports;var c=h[a]={i:a,l:!1,exports:{}};g[a].call(c.exports,c,c.exports,e);c.l=!0;return c.exports}var h={};e.m=g;e.c=h;e.d=function(a,c,d){e.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})};e.n=function(a){var c=a&&a.__esModule?function(){return a["default"]}:function(){return a};e.d(c,"a",c);return c};e.o=function(a,c){return Object.prototype.hasOwnProperty.call(a,c)};e.p="";return e(e.s=0)})([function(g,e,h){Object.defineProperty(e,
"__esModule",{value:!0});g=h(1);h=h(2);e="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"===typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};"object"!==e(window.themehouse)&&(window.themehouse={});"object"!==e(window.themehouse.settings)&&(window.themehouse.settings={});"object"!==e(window.themehouse.settings.data)&&(window.themehouse.settings.data={});window.themehouse.settings.data.jsVersion=
"2.0.10.0_Release";(new g.a({settings:window.themehouse.settings.sticky})).register();(new h.a({settings:window.themehouse.settings.checkRadius})).register()},function(g,e,h){var a=function(){function c(d,b){for(var f=0;f<b.length;f++){var c=b[f];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(d,c.key,c)}}return function(d,b,f){b&&c(d.prototype,b);f&&c(d,f);return d}}();g=function(){function c(d){var b=this,f=d.settings;f=void 0===f?{}:f;var a=d.init;
a=void 0===a?!1:a;d=d.commonVersion;d=void 0===d?"20180112":d;if(!(this instanceof c))throw new TypeError("Cannot call a class as a function");this.initEle=function(d){var c=b.eles[d],k=c.offsets,f=k.topOffsetMax,a=k.topOffsetMin,l=k.topOffsetBreakpoint;k=Math.max(k.topOffset,f,a,0);-1!==l&&(k=b.common.values.innerWidth>l?f:a);k!==c.currentOffset&&(f=jQuery(c.ele),-1!==c.currentOffset&&f.trigger("sticky_kit:detach").removeData("sticky_kit"),f.stick_in_parent({sticky_class:b.settings.stickyClass,offset_top:k}),
b.eles[d].currentOffset=k)};this.init=function(){b.initGet();b.initSet()};this.initGet=function(){for(var d=window.document.querySelectorAll(b.settings.stickySelector),c=0,f=d.length;c<f;c++){var a=d[c],e=parseInt(a.getAttribute(b.settings.dataTop),10)||0,m=parseInt(a.getAttribute(b.settings.dataTopMin),10)||0,g=parseInt(a.getAttribute(b.settings.dataTopMax),10)||0,h=parseInt(a.getAttribute(b.settings.dataTopBreakpoint),10)||-1;b.eles.push({ele:a,offsets:{topOffset:e,topOffsetMax:g,topOffsetMin:m,
topOffsetBreakpoint:h},currentOffset:-1})}b.resizeGet();$(window).on("resize.sticky-header",$.proxy(b,"update"))};this.initSet=function(){b.resizeSet();b.running=!0};this.resize=function(){b.resizeGet();b.resizeSet()};this.resizeGet=function(){};this.resizeSet=function(){b.common.values.innerHeight<b.settings.minWindowHeight?!1!==b.active&&b.disable():b.active||b.enable();for(var d=0,c=b.eles.length;d<c;d++)b.initEle(d)};this.running=!1;this.settings=Object.assign({stickySelector:".uix_stickyBar",
stickyClass:"is-sticky",stickyBrokenClass:"is-sticky-broken",stickyDisabledClass:"is-sticky-disabled",minWindowHeight:251,dataTop:"data-top-offset",dataTopMin:"data-top-offset-min",dataTopMax:"data-top-offset-max",dataTopBreakpoint:"data-top-offset-breakpoint"},f);this.commonVersion=d;this.common=window.themehouse.common[d];this.stickyBroken=this.supportsSticky=this.active=!1;this.eles=[];a&&this.init()}a(c,[{key:"register",value:function(){this.common.register({phase:"initGet",addon:"TH_UIX_Sticky",
func:this.initGet,order:10});this.common.register({phase:"initSet",addon:"TH_UIX_Sticky",func:this.initSet,order:10});this.common.register({phase:"resizeGet",addon:"TH_UIX_Sticky",func:this.resizeGet,order:10});this.common.register({phase:"resizeSet",addon:"TH_UIX_Sticky",func:this.resizeSet,order:100})}},{key:"enable",value:function(){var d=this;this.active=!0;for(var b=function(b,c){var a=d.eles[b].ele;a.classList.remove(d.settings.stickyDisabledClass);d.supportsSticky||(d.stickyBroken&&setTimeout(function(){a.classList.add(d.settings.stickyBrokenClass)},
0),d.initEle(b))},c=0,a=this.eles.length;c<a;c++)b(c,a)}},{key:"disable",value:function(){this.active=!1;this.supportsSticky&&window.jQuery(window).off("scroll.sticky-header");for(var d=0,b=this.eles.length;d<b;d++){var c=this.eles[d].ele;this.supportsSticky&&window.jQuery(c).trigger("sticky_kit:detach").removeData("sticky_kit");c.classList.remove(this.settings.stickyClass);c.classList.remove(this.settings.stickyBrokenClass);c.classList.remove(this.settings.stickyDisabledClass)}}}]);return c}();"undefined"===
typeof window.themehouse&&(window.themehouse={});window.themehouse.sticky={sticky:g};e.a=g},function(g,e,h){var a=function(){function c(c,b){for(var d=0;d<b.length;d++){var a=b[d];a.enumerable=a.enumerable||!1;a.configurable=!0;"value"in a&&(a.writable=!0);Object.defineProperty(c,a.key,a)}}return function(d,b,a){b&&c(d.prototype,b);a&&c(d,a);return d}}();g=function(){function c(a){var b=this,d=a.settings;d=void 0===d?{}:d;var e=a.init;e=void 0===e?!1:e;a=a.commonVersion;a=void 0===a?"20180112":a;
if(!(this instanceof c))throw new TypeError("Cannot call a class as a function");this.init=function(){b.initGet();b.initSet()};this.initGet=function(){if(b.settings.enabled){var a=b.settings.selectors.split(",");if(a.length){for(var c=0,d=a.length;c<d;c++){var e=a[c];if(e.length)for(var f=window.document.querySelectorAll(e),g=0,h=f.length;g<h;g++)b.eles.push({ele:f[g],selector:e,lastClass:"",height:-1,topOffset:-1,topRadius:!0,bottomRadius:!0})}b.resizeGet()}}};this.initSet=function(){b.settings.enabled&&
(b.resizeSet(),b.running=!0)};this.resize=function(){b.resizeGet();b.resizeSet()};this.resizeGet=function(){b.settings.enabled&&b.checkGet()};this.resizeSet=function(){b.settings.enabled&&b.checkSet()};this.check=function(){b.checkGet();b.checkSet()};this.checkGet=function(){if(b.settings.enabled)for(var a=window.document.body.scrollTop||0,c=0,d=b.eles.length;c<d;c++){var e=b.eles[c].ele,f=e.getBoundingClientRect();b.eles[c].height=e.offsetHeight;b.eles[c].width=e.offsetWidth;b.eles[c].topOffset=
f.top+a}};this.checkSet=function(){if(b.settings.enabled)for(var a=0,c=b.eles.length;a<c;a++){var d=b.eles[a];if(d.width===b.common.values.innerWidth)b.eles[a].topRadius=!1,b.eles[a].bottomRadius=!1;else for(var e=0;e<c;e++)if(a!==e){var f=b.eles[e];1>Math.abs(d.topOffset-(f.topOffset+f.height))&&(b.eles[a].topRadius=!1);1>Math.abs(d.topOffset+d.height-f.topOffset)&&(b.eles[a].bottomRadius=!1)}e=b.settings.defaultClass;d.topRadius||d.bottomRadius?d.topRadius?d.bottomRadius||(e=b.settings.noBottomClass):
e=b.settings.noTopClass:e=b.settings.noBorderClass;e!==d.lastClass&&(d.lastClass&&d.ele.classList.remove(d.lastClass),d.ele.classList.add(e),d.lastClass=e)}};this.running=!1;this.settings=Object.assign({enabled:!1,selectors:"",defaultClass:"uix_smartBorder--default",noTopClass:"uix_smartBorder--noTop",noBottomClass:"uix_smartBorder--noBottom",noBorderClass:"uix_smartBorder--noBoth"},d);this.commonVersion=a;this.common=window.themehouse.common[a];this.eles=[];e&&this.init()}a(c,[{key:"register",value:function(){this.settings.enabled&&
(this.common.register({phase:"initGet",addon:"TH_UIX_CheckRadius",func:this.initGet,order:100}),this.common.register({phase:"initSet",addon:"TH_UIX_CheckRadius",func:this.initSet,order:100}),this.common.register({phase:"resizeGet",addon:"TH_UIX_CheckRadius",func:this.resizeGet,order:10}),this.common.register({phase:"resizeSet",addon:"TH_UIX_CheckRadius",func:this.resizeSet,order:10}))}}]);return c}();"undefined"===typeof window.themehouse&&(window.themehouse={});window.themehouse.checkRadius={checkRadius:g};
e.a=g}]);