Skip to content
Browse files

Merge pull request #176 from enyojs/ENYO-1306

ENYO-1306: add silk browser detection separate from Android version, add...
  • Loading branch information...
2 parents cb056d1 + b4ec121 commit e877f133aec94fa7645c5f3b4aabd96bd60ef79a @unwiredben unwiredben committed Nov 15, 2012
Showing with 7 additions and 3 deletions.
  1. +5 −2 source/dom/platform.js
  2. +2 −1 source/touch/touch.js
View
7 source/dom/platform.js
@@ -41,10 +41,10 @@ enyo.platform = {
{platform: "android", regex: /Android (\d+)/},
// Kindle Fire
// Force version to 2, (desktop mode does not list android version)
- {platform: "android", regex: /Silk\/1./, forceVersion: 2},
+ {platform: "android", regex: /Silk\/1./, forceVersion: 2, extra: {silk: 1}},
// Kindle Fire HD
// Force version to 4
- {platform: "android", regex: /Silk\/2./, forceVersion: 4},
+ {platform: "android", regex: /Silk\/2./, forceVersion: 4, extra: {silk: 2}},
// IE 8 - 10
{platform: "ie", regex: /MSIE (\d+)/},
// iOS 3 - 5
@@ -70,6 +70,9 @@ enyo.platform = {
v = Number(m[1]);
}
ep[p.platform] = v;
+ if (p.extra) {
+ enyo.mixin(ep, p.extra);
+ }
break;
}
}
View
3 source/touch/touch.js
@@ -119,9 +119,10 @@ enyo.requiresWindow(function() {
document[e] = enyo.dispatch;
});
// use proper target finding technique based on feature detection.
- if (enyo.platform.androidChrome <= 18) {
+ if (enyo.platform.androidChrome <= 18 || enyo.platform.silk === 2) {
// HACK: on Chrome for Android v18 on devices with higher density displays,
// document.elementFromPoint expects screen coordinates, not document ones
+ // bug also appears on Kindle Fire HD
this.findTarget = function(e) {
return document.elementFromPoint(e.screenX, e.screenY);
};

0 comments on commit e877f13

Please sign in to comment.
Something went wrong with that request. Please try again.