foundation-sites
Version:
The most advanced responsive front-end framework in the world.
3 lines (2 loc) • 5.98 kB
JavaScript
((e,n)=>{"object"==typeof exports&&"object"==typeof module?module.exports=n(require("./foundation.core"),require("jquery"),require("./foundation.util.mediaQuery"),require("./foundation.dropdownMenu"),require("./foundation.drilldown"),require("./foundation.accordionMenu")):"function"==typeof define&&define.amd?define(["./foundation.core","jquery","./foundation.util.mediaQuery","./foundation.dropdownMenu","./foundation.drilldown","./foundation.accordionMenu"],n):"object"==typeof exports?exports.__FOUNDATION_EXTERNAL__=n(require("./foundation.core"),require("jquery"),require("./foundation.util.mediaQuery"),require("./foundation.dropdownMenu"),require("./foundation.drilldown"),require("./foundation.accordionMenu")):(e.__FOUNDATION_EXTERNAL__=e.__FOUNDATION_EXTERNAL__||{},e.__FOUNDATION_EXTERNAL__["foundation.responsiveMenu"]=n(e.__FOUNDATION_EXTERNAL__["foundation.core"],e.jQuery,e.__FOUNDATION_EXTERNAL__["foundation.util.mediaQuery"],e.__FOUNDATION_EXTERNAL__["foundation.dropdownMenu"],e.__FOUNDATION_EXTERNAL__["foundation.drilldown"],e.__FOUNDATION_EXTERNAL__["foundation.accordionMenu"]))})(self,function(n,t,o,r,i,u){return a={"./js/foundation.responsiveMenu.js":function(e,n,t){t.r(n),t.d(n,{ResponsiveMenu:function(){return y}});var n=t("jquery"),i=t.n(n),u=t("./foundation.util.mediaQuery"),s=t("./foundation.core"),n=t("./foundation.dropdownMenu"),o=t("./foundation.drilldown"),t=t("./foundation.accordionMenu");function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(e=>(e=((e,n)=>{if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return("string"===n?String:Number)(e);if("object"!=r(t=t.call(e,n||"default")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==r(e)?e:e+""))(o.key),o)}}function c(e,n,t){n=l(n);var o=e,n=d()?Reflect.construct(n,t||[],l(e).constructor):n.apply(e,t);if(!n||"object"!=r(n)&&"function"!=typeof n){if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");if(void 0===(n=o))throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return n}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function(){return!!e})()}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,n){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e})(e,n)}var p={dropdown:{cssClass:"dropdown",plugin:n.DropdownMenu},drilldown:{cssClass:"drilldown",plugin:o.Drilldown},accordion:{cssClass:"accordion-menu",plugin:t.AccordionMenu}},y=(e=>{function t(){var e=this,n=t;if(e instanceof n)return c(this,t,arguments);throw new TypeError("Cannot call a class as a function")}var n,o=t;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");return o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&f(o,e),o=t,(e=[{key:"_setup",value:function(e){this.$element=i()(e),this.rules=this.$element.data("responsive-menu"),this.currentMq=null,this.currentPlugin=null,this.className="ResponsiveMenu",this._init(),this._events()}},{key:"_init",value:function(){if(u.MediaQuery._init(),"string"==typeof this.rules){for(var e={},n=this.rules.split(" "),t=0;t<n.length;t++){var o=n[t].split("-"),r=1<o.length?o[0]:"small",o=1<o.length?o[1]:o[0];null!==p[o]&&(e[r]=p[o])}this.rules=e}i().isEmptyObject(this.rules)||this._checkMediaQueries(),this.$element.attr("data-mutate",this.$element.attr("data-mutate")||(0,s.GetYoDigits)(6,"responsive-menu"))}},{key:"_events",value:function(){var e=this;i()(window).on("changed.zf.mediaquery",function(){e._checkMediaQueries()})}},{key:"_checkMediaQueries",value:function(){var n,t=this;i().each(this.rules,function(e){u.MediaQuery.atLeast(e)&&(n=e)}),!n||this.currentPlugin instanceof this.rules[n].plugin||(i().each(p,function(e,n){t.$element.removeClass(n.cssClass)}),this.$element.addClass(this.rules[n].cssClass),this.currentPlugin&&this.currentPlugin.destroy(),this.currentPlugin=new this.rules[n].plugin(this.$element,{}))}},{key:"_destroy",value:function(){this.currentPlugin.destroy(),i()(window).off(".zf.ResponsiveMenu")}}])&&a(o.prototype,e),n&&a(o,n),Object.defineProperty(o,"prototype",{writable:!1}),o})(s.Plugin);y.defaults={}},"./foundation.accordionMenu":function(e){e.exports=u},"./foundation.core":function(e){e.exports=n},"./foundation.drilldown":function(e){e.exports=i},"./foundation.dropdownMenu":function(e){e.exports=r},"./foundation.util.mediaQuery":function(e){e.exports=o},jquery:function(e){e.exports=t}},c={},s.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(n,{a:n}),n},s.d=function(e,n){for(var t in n)s.o(n,t)&&!s.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},s.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},l={},(s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(l),s.d(l,{Foundation:function(){return e.Foundation},ResponsiveMenu:function(){return d.ResponsiveMenu}}),e=s("./foundation.core"),d=s("./js/foundation.responsiveMenu.js"),e.Foundation.plugin(d.ResponsiveMenu,"ResponsiveMenu"),l;function s(e){var n=c[e];return void 0!==n||(n=c[e]={exports:{}},a[e](n,n.exports,s)),n.exports}var a,c,e,d,l});
//# sourceMappingURL=foundation.responsiveMenu.min.js.map