biofriction-wp-theme/node_modules/foundation-sites/dist/js/plugins/foundation.util.mediaQuery....

3 lines
4.3 KiB
JavaScript

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("./foundation.core"),require("jquery")):"function"==typeof define&&define.amd?define(["./foundation.core","jquery"],t):"object"==typeof exports?exports["foundation.util.mediaQuery"]=t(require("./foundation.core"),require("jquery")):(e.__FOUNDATION_EXTERNAL__=e.__FOUNDATION_EXTERNAL__||{},e.__FOUNDATION_EXTERNAL__["foundation.util.mediaQuery"]=t(e.__FOUNDATION_EXTERNAL__["foundation.core"],e.jQuery))}(window,function(n,r){return function(n){var r={};function i(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return i.m=n,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=24)}({"./foundation.core":function(e,t){e.exports=n},"./js/entries/plugins/foundation.util.mediaQuery.js":function(e,t,n){"use strict";n.r(t);var r=n("./foundation.core");n.d(t,"Foundation",function(){return r.Foundation});var i=n("./js/foundation.util.mediaQuery.js");n.d(t,"MediaQuery",function(){return i.MediaQuery}),r.Foundation.MediaQuery=i.MediaQuery,r.Foundation.MediaQuery._init()},"./js/foundation.util.mediaQuery.js":function(e,t,n){"use strict";n.r(t),n.d(t,"MediaQuery",function(){return u});var r=n("jquery"),o=n.n(r);function i(e){return(i="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)}window.matchMedia||(window.matchMedia=function(){var t=window.styleMedia||window.media;if(!t){var n,r=document.createElement("style"),e=document.getElementsByTagName("script")[0];r.type="text/css",r.id="matchmediajs-test",e?e.parentNode.insertBefore(r,e):document.head.appendChild(r),n="getComputedStyle"in window&&window.getComputedStyle(r,null)||r.currentStyle,t={matchMedium:function(e){var t="@media "+e+"{ #matchmediajs-test { width: 1px; } }";return r.styleSheet?r.styleSheet.cssText=t:r.textContent=t,"1px"===n.width}}}return function(e){return{matches:t.matchMedium(e||"all"),media:e||"all"}}}());var u={queries:[],current:"",_init:function(){o()("meta.foundation-mq").length||o()('<meta class="foundation-mq">').appendTo(document.head);var e,t,n,r=o()(".foundation-mq").css("font-family");for(var i in n={},e="string"==typeof(t=r)&&(t=t.trim().slice(1,-1))?n=t.split("&").reduce(function(e,t){var n=t.replace(/\+/g," ").split("="),r=n[0],i=n[1];return r=decodeURIComponent(r),i=void 0===i?null:decodeURIComponent(i),e.hasOwnProperty(r)?Array.isArray(e[r])?e[r].push(i):e[r]=[e[r],i]:e[r]=i,e},{}):n)e.hasOwnProperty(i)&&this.queries.push({name:i,value:"only screen and (min-width: ".concat(e[i],")")});this.current=this._getCurrentSize(),this._watcher()},atLeast:function(e){var t=this.get(e);return!!t&&window.matchMedia(t).matches},is:function(e){return 1<(e=e.trim().split(" ")).length&&"only"===e[1]?e[0]===this._getCurrentSize():this.atLeast(e[0])},get:function(e){for(var t in this.queries)if(this.queries.hasOwnProperty(t)){var n=this.queries[t];if(e===n.name)return n.value}return null},_getCurrentSize:function(){for(var e,t=0;t<this.queries.length;t++){var n=this.queries[t];window.matchMedia(n.value).matches&&(e=n)}return"object"===i(e)?e.name:e},_watcher:function(){var n=this;o()(window).off("resize.zf.mediaquery").on("resize.zf.mediaquery",function(){var e=n._getCurrentSize(),t=n.current;e!==t&&(n.current=e,o()(window).trigger("changed.zf.mediaquery",[e,t]))})}}},24:function(e,t,n){e.exports=n("./js/entries/plugins/foundation.util.mediaQuery.js")},jquery:function(e,t){e.exports=r}})});
//# sourceMappingURL=foundation.util.mediaQuery.min.js.map