Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/mq4-hover-shim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Rebert <code@rebertia.com>2015-01-03 12:55:10 +0300
committerChris Rebert <code@rebertia.com>2015-01-03 12:55:10 +0300
commitd66c42f906d2e2ea71ff921bed4edc916f0a4038 (patch)
tree2348a98343104eca611d85ba2c71f878a55ab15b
parent9ffc34ea5c5e3a3db8af1b357a3b71594e0c9c51 (diff)
grunt dist
-rw-r--r--dist/browser/mq4-hover-hover-shim.js17
-rw-r--r--dist/cjs/mq4-hover-hover-shim.js17
2 files changed, 18 insertions, 16 deletions
diff --git a/dist/browser/mq4-hover-hover-shim.js b/dist/browser/mq4-hover-hover-shim.js
index 17e5821..81a16bb 100644
--- a/dist/browser/mq4-hover-hover-shim.js
+++ b/dist/browser/mq4-hover-hover-shim.js
@@ -21,11 +21,16 @@ exports.supportsTrueHover = supportsTrueHover;
*/
function supportsTrueHover() {
if (!window.matchMedia) {
- // Ancient non-IE, or IE<=9, per http://caniuse.com/#feat=matchmedia
+ // Opera Mini, IE<=9, or ancient; per http://caniuse.com/#feat=matchmedia
var ua = navigator.userAgent;
- var isIE9mobileInMobileMode = ua.indexOf("MSIE 9.0") > -1 && (ua.indexOf("XBLWP7") > -1 || ua.indexOf("ZuneWP7") > -1);
- if (isIE9mobileInMobileMode) {
- // FIXME: IE9 Mobile in Mobile mode; force hoverEnabled to false???
+ if (ua.indexOf("Opera Mini") > -1) {
+ // Opera Mini doesn't support true hovering
+ return false;
+ }
+ if (ua.indexOf("IEMobile") > -1 || ua.indexOf("Windows Phone") > -1 || ua.indexOf("XBLWP7") > -1 || ua.indexOf("ZuneWP7") > -1 || // IE Mobile 9 in desktop view
+ ua.indexOf("Windows CE") > -1 // out of an abundance of caution
+ ) {
+ // IE Mobile <=9
return false;
}
// UA is ancient enough to probably be a desktop computer or at least not attempt emulation of hover.
@@ -34,7 +39,6 @@ function supportsTrueHover() {
// CSSWG Media Queries Level 4 draft
// http://drafts.csswg.org/mediaqueries/#hover
- // FIXME: WTF Chrome...: https://code.google.com/p/chromium/issues/detail?id=441613
if (window.matchMedia("(hover: none),(-moz-hover: none),(-ms-hover: none),(-webkit-hover: none)," + "(hover: on-demand),(-moz-hover: on-demand),(-ms-hover: on-demand),(-webkit-hover: on-demand)").matches) {
// true hovering explicitly not supported by primary pointer
return false;
@@ -70,9 +74,6 @@ function supportsTrueHover() {
return false;
}
- // OPEN ISSUE: Should we look for IE's "Touch" userAgent token?
- // OPEN ISSUE: IE10 Mobile?
-
// UA's pointer is non-touch and thus likely either supports true hovering or at least does not try to emulate it.
return true;
}
diff --git a/dist/cjs/mq4-hover-hover-shim.js b/dist/cjs/mq4-hover-hover-shim.js
index 5db3edc..6955bff 100644
--- a/dist/cjs/mq4-hover-hover-shim.js
+++ b/dist/cjs/mq4-hover-hover-shim.js
@@ -13,11 +13,16 @@ exports.supportsTrueHover = supportsTrueHover;
*/
function supportsTrueHover() {
if (!window.matchMedia) {
- // Ancient non-IE, or IE<=9, per http://caniuse.com/#feat=matchmedia
+ // Opera Mini, IE<=9, or ancient; per http://caniuse.com/#feat=matchmedia
var ua = navigator.userAgent;
- var isIE9mobileInMobileMode = ua.indexOf("MSIE 9.0") > -1 && (ua.indexOf("XBLWP7") > -1 || ua.indexOf("ZuneWP7") > -1);
- if (isIE9mobileInMobileMode) {
- // FIXME: IE9 Mobile in Mobile mode; force hoverEnabled to false???
+ if (ua.indexOf("Opera Mini") > -1) {
+ // Opera Mini doesn't support true hovering
+ return false;
+ }
+ if (ua.indexOf("IEMobile") > -1 || ua.indexOf("Windows Phone") > -1 || ua.indexOf("XBLWP7") > -1 || ua.indexOf("ZuneWP7") > -1 || // IE Mobile 9 in desktop view
+ ua.indexOf("Windows CE") > -1 // out of an abundance of caution
+ ) {
+ // IE Mobile <=9
return false;
}
// UA is ancient enough to probably be a desktop computer or at least not attempt emulation of hover.
@@ -26,7 +31,6 @@ function supportsTrueHover() {
// CSSWG Media Queries Level 4 draft
// http://drafts.csswg.org/mediaqueries/#hover
- // FIXME: WTF Chrome...: https://code.google.com/p/chromium/issues/detail?id=441613
if (window.matchMedia("(hover: none),(-moz-hover: none),(-ms-hover: none),(-webkit-hover: none)," + "(hover: on-demand),(-moz-hover: on-demand),(-ms-hover: on-demand),(-webkit-hover: on-demand)").matches) {
// true hovering explicitly not supported by primary pointer
return false;
@@ -62,9 +66,6 @@ function supportsTrueHover() {
return false;
}
- // OPEN ISSUE: Should we look for IE's "Touch" userAgent token?
- // OPEN ISSUE: IE10 Mobile?
-
// UA's pointer is non-touch and thus likely either supports true hovering or at least does not try to emulate it.
return true;
} \ No newline at end of file