aboutsummaryrefslogtreecommitdiff
path: root/js/polyfills/matchMedia.js
diff options
context:
space:
mode:
authorEric Bidelman2012-07-11 10:43:37 -0700
committerEric Bidelman2012-07-11 10:43:37 -0700
commitf208307cbdd403d3fa92a1aae1dc9c094c7ec9d8 (patch)
treeeb8ac9966f182313db6b11e12c2f4fd5bab070b7 /js/polyfills/matchMedia.js
parentd78d1c5069ecdb6723a8933dbb86f4b7a20c59e9 (diff)
downloadio-slides-remote-f208307cbdd403d3fa92a1aae1dc9c094c7ec9d8.tar.gz
Bringing in upstream changes
Diffstat (limited to 'js/polyfills/matchMedia.js')
-rw-r--r--js/polyfills/matchMedia.js30
1 files changed, 0 insertions, 30 deletions
diff --git a/js/polyfills/matchMedia.js b/js/polyfills/matchMedia.js
deleted file mode 100644
index 6d4d17c..0000000
--- a/js/polyfills/matchMedia.js
+++ /dev/null
@@ -1,30 +0,0 @@
1/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
2
3window.matchMedia = window.matchMedia || (function(doc, undefined){
4
5 var bool,
6 docElem = doc.documentElement,
7 refNode = docElem.firstElementChild || docElem.firstChild,
8 // fakeBody required for <FF4 when executed in <head>
9 fakeBody = doc.createElement('body'),
10 div = doc.createElement('div');
11
12 div.id = 'mq-test-1';
13 div.style.cssText = "position:absolute;top:-100em";
14 fakeBody.style.background = "none";
15 fakeBody.appendChild(div);
16
17 return function(q){
18
19 div.innerHTML = '&shy;<style media="'+q+'"> #mq-test-1 { width: 42px; }</style>';
20
21 docElem.insertBefore(fakeBody, refNode);
22 bool = div.offsetWidth == 42;
23 docElem.removeChild(fakeBody);
24
25 return { matches: bool, media: q };
26 };
27
28})(document);
29
30