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
path: root/src
diff options
context:
space:
mode:
authorChris Rebert <code@rebertia.com>2015-01-03 10:18:39 +0300
committerChris Rebert <code@rebertia.com>2015-01-03 10:18:39 +0300
commitdfe20fad498f6adae0553a9a8b05bb01608bc6e2 (patch)
treef5a16c04de68124f0a8d2fda38ba8f8378ac1e79 /src
parentdce6167ebcee6935f08abefefbaad70aea3b1ed3 (diff)
try to support Opera Mini
Diffstat (limited to 'src')
-rw-r--r--src/browser/mq4-hover-hover-shim.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/browser/mq4-hover-hover-shim.js b/src/browser/mq4-hover-hover-shim.js
index 5937e39..de2a022 100644
--- a/src/browser/mq4-hover-hover-shim.js
+++ b/src/browser/mq4-hover-hover-shim.js
@@ -10,15 +10,22 @@
*/
export 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 isIEmobile = (
+ 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.
- return !isIEmobile;
+ return true;
}
// CSSWG Media Queries Level 4 draft