ab-mediaquery
Advanced tools
Comparing version 1.3.1 to 1.3.2
!(function(name, definition) { | ||
if (typeof module != 'undefined') { | ||
module.exports = definition(); | ||
} else if (typeof define == 'function' && typeof define.amd == 'object') { | ||
define(definition); | ||
} else { | ||
this[name] = definition(); | ||
} | ||
if (typeof module !== 'undefined') module.exports = definition(); | ||
else if (typeof define === 'function' && typeof define.amd === 'object') define(definition); | ||
else this[name] = definition(); | ||
}('abMediaQuery', function() { | ||
'use strict'; | ||
// For IE 9 and 10 (https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent) | ||
if (typeof window.CustomEvent !== 'function') { | ||
function CustomEvent( event, params ){ | ||
params = params || { bubbles: false, cancelable: false, detail: undefined }; | ||
var evt = document.createEvent( 'CustomEvent' ); | ||
evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail ); | ||
return evt; | ||
} | ||
CustomEvent.prototype = window.Event.prototype; | ||
window.CustomEvent = CustomEvent; | ||
} | ||
'use strict'; // voluntarily after window.CustomEvent polyfill | ||
function extend(){ | ||
@@ -35,15 +43,3 @@ for (var i=1; i<arguments.length; i++) { | ||
// For IE 9 and 10 | ||
if (typeof window.CustomEvent !== "function") { | ||
function CustomEvent(event, params ){ | ||
params = params || { bubbles: false, cancelable: false, detail: undefined }; | ||
var evt = document.createEvent( 'CustomEvent' ); | ||
evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail ); | ||
return evt; | ||
} | ||
CustomEvent.prototype = window.Event.prototype; | ||
window.CustomEvent = CustomEvent; | ||
} | ||
var MediaQuery = function(opt) { | ||
@@ -127,3 +123,2 @@ if (!(this instanceof MediaQuery)) return new MediaQuery(opt); | ||
//if (typeof matched === 'object') return matched.name; | ||
return newMediaQueries; | ||
@@ -134,3 +129,3 @@ }, | ||
var metaMD = document.getElementById('AB-mediaQuery'), | ||
fontMD = window.getComputedStyle(metaMD, null).getPropertyValue("font-family"), | ||
fontMD = window.getComputedStyle(metaMD, null).getPropertyValue('font-family'), | ||
extractedStyles = decodeURI(fontMD.trim().slice(1, -1)); | ||
@@ -148,3 +143,3 @@ | ||
var that = this, | ||
event = new CustomEvent('changed.ab-mediaquery'), | ||
event = new Event('changed.ab-mediaquery'), | ||
newSize, resizeTimer; | ||
@@ -151,0 +146,0 @@ |
{ | ||
"name": "ab-mediaquery", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "AB-mediaQuery is the JavaScript side of Media Queries. It proposes you some very useful methods for your scripts", | ||
@@ -5,0 +5,0 @@ "main": "AB-mediaQuery.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12924
138