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