shido.regular.js
Version:
2 lines • 3.31 kB
JavaScript
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";n.r(t);var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="%c"+e+"%c"+t,r="background: #ef5350; color: #fff; font-weight: bold; padding: 5px;",o="background: #fafafa; color: #888; font-weight: bold; padding: 5px;";console.log(n,r,o)},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="%c"+e+"%c"+t,r="background: #ffc400; color: #fff; font-weight: bold; padding: 5px;",o="background: #fafafa; color: #888; font-weight: bold; padding: 5px;";console.log(n,r,o)};function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,u;return t=e,(n=[{key:"getParams",value:function(e){return e.replace(/\s/g,"").split(",")}},{key:"setItems",value:function(){var e=this;document.querySelectorAll("[regular]").forEach((function(t,n){var r=e.getParams(t.getAttribute("regular")),o=r[0],i=isNaN(r[1])?0:r[1],u=window.innerWidth,a=0,l=0;u<i&&t.querySelectorAll("."+o).forEach((function(e,t){e.style.height="auto"})),u>=i&&(t.querySelectorAll("."+o).forEach((function(e,t){e.style.height="auto"})),t.querySelectorAll("."+o).forEach((function(e,t){(a=e.offsetHeight)>=l&&(l=a)})),t.querySelectorAll("."+o).forEach((function(e,t){e.style.height=l+"px"})))}))}},{key:"regularAvailable",value:function(){var e=this,t=!0;return document.querySelectorAll("[regular]").forEach((function(n,i){var u=e.getParams(n.getAttribute("regular"))[0];void 0!==u&&""!==u||(o("Dimentions","Item "+(i+1)+": Empty class"),t=!1),void 0!==u&&""!==u&&null===document.querySelector("."+u)&&(r("Dimentions","Item "+(i+1)+": Missing a valid class"),t=!1)})),t}},{key:"process",value:function(){var e,t=this;this.setItems(),window.addEventListener("load",(function(){t.setItems()})),window.addEventListener("resize",(function(){clearTimeout(e),e=setTimeout((function(){t.setItems()}),250)}),!1)}},{key:"init",value:function(){this.regularAvailable()&&this.process()}}])&&i(t.prototype,n),u&&i(t,u),e}();t.default=u}]);
//# sourceMappingURL=regular.min.js.map