PHP Classes

File: engine/modules/contrib/foundation/js/plugins/foundation.responsiveMenu.min.js

Recommend this page to a friend!
  Classes of Aldo Tripiciano   Quanta CMS   engine/modules/contrib/foundation/js/plugins/foundation.responsiveMenu.min.js   Download  
File: engine/modules/contrib/foundation/js/plugins/foundation.responsiveMenu.min.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Quanta CMS
Manage content that works without a database
Author: By
Last change:
Date: 5 years ago
Size: 2,041 bytes
 

Contents

Class file image Download
"use strict";function _classCallCheck(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(n,t,i){return t&&e(n.prototype,t),i&&e(n,i),n}}();!function(e){var n=function(){function n(t,i){_classCallCheck(this,n),this.$element=e(t),this.rules=this.$element.data("responsive-menu"),this.currentMq=null,this.currentPlugin=null,this._init(),this._events(),Foundation.registerPlugin(this,"ResponsiveMenu")}return _createClass(n,[{key:"_init",value:function(){if("string"==typeof this.rules){for(var n={},i=this.rules.split(" "),s=0;s<i.length;s++){var u=i[s].split("-"),l=u.length>1?u[0]:"small",r=u.length>1?u[1]:u[0];null!==t[r]&&(n[l]=t[r])}this.rules=n}e.isEmptyObject(this.rules)||this._checkMediaQueries(),this.$element.attr("data-mutate",this.$element.attr("data-mutate")||Foundation.GetYoDigits(6,"responsive-menu"))}},{key:"_events",value:function(){var n=this;e(window).on("changed.zf.mediaquery",function(){n._checkMediaQueries()})}},{key:"_checkMediaQueries",value:function(){var n,i=this;e.each(this.rules,function(e){Foundation.MediaQuery.atLeast(e)&&(n=e)}),n&&(this.currentPlugin instanceof this.rules[n].plugin||(e.each(t,function(e,n){i.$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(),e(window).off(".zf.ResponsiveMenu"),Foundation.unregisterPlugin(this)}}]),n}();n.defaults={};var t={dropdown:{cssClass:"dropdown",plugin:Foundation._plugins["dropdown-menu"]||null},drilldown:{cssClass:"drilldown",plugin:Foundation._plugins.drilldown||null},accordion:{cssClass:"accordion-menu",plugin:Foundation._plugins["accordion-menu"]||null}};Foundation.plugin(n,"ResponsiveMenu")}(jQuery);