-
Notifications
You must be signed in to change notification settings - Fork 3
/
mq-listener.min.js
1 lines (1 loc) · 1.86 KB
/
mq-listener.min.js
1
(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.mqListener=e()}})(function(){var e,t,n;return function r(e,t,n){function i(f,u){if(!t[f]){if(!e[f]){var a=typeof require=="function"&&require;if(!u&&a)return a(f,!0);if(o)return o(f,!0);var s=new Error("Cannot find module '"+f+"'");throw s.code="MODULE_NOT_FOUND",s}var d=t[f]={exports:{}};e[f][0].call(d.exports,function(t){var n=e[f][1][t];return i(n?n:t)},d,d.exports,r,e,t,n)}return t[f].exports}var o=typeof require=="function"&&require;for(var f=0;f<n.length;f++)i(n[f]);return i}({1:[function(e,t,n){"use strict";var r=e("tiny-emitter");var i=new r;if(window&&window.getComputedStyle&&window.addEventListener){var o,f;var u=function(){if(!o){o=window.getComputedStyle(document.body,":after")}return o.getPropertyValue("content").replace(/'|"/g,"")};var a=function(e){i.emit(e).emit("change",e)};var s=function(){var e=u();if(e!==f){a(e);f=e}};window.addEventListener("load",s);window.addEventListener("resize",s)}t.exports=i},{"tiny-emitter":2}],2:[function(e,t,n){function r(){}r.prototype={on:function(e,t,n){var r=this.e||(this.e={});(r[e]||(r[e]=[])).push({fn:t,ctx:n});return this},once:function(e,t,n){var r=this;function i(){r.off(e,i);t.apply(n,arguments)}i._=t;return this.on(e,i,n)},emit:function(e){var t=[].slice.call(arguments,1);var n=((this.e||(this.e={}))[e]||[]).slice();var r=0;var i=n.length;for(r;r<i;r++){n[r].fn.apply(n[r].ctx,t)}return this},off:function(e,t){var n=this.e||(this.e={});var r=n[e];var i=[];if(r&&t){for(var o=0,f=r.length;o<f;o++){if(r[o].fn!==t&&r[o].fn._!==t)i.push(r[o])}}i.length?n[e]=i:delete n[e];return this}};t.exports=r},{}]},{},[1])(1)});