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