[Pkg-javascript-commits] [dojo] 98/149: Fix has("MSPointer") and has("pointer-events") on embedded C# WebBrowser Controls. Fixes #18602 again. First try apparently didn't work.

David Prévot taffit at moszumanska.debian.org
Sat Feb 27 03:13:52 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository dojo.

commit 1d3a775302afdf33df9dea85457625aa9860de71
Author: Bill Keese <bill at dojotoolkit.org>
Date:   Mon Nov 23 11:40:06 2015 +0900

    Fix has("MSPointer") and has("pointer-events") on embedded C# WebBrowser Controls.
    Fixes #18602 again.  First try apparently didn't work.
---
 has.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/has.js b/has.js
index f1006c3..18e6955 100644
--- a/has.js
+++ b/has.js
@@ -109,9 +109,13 @@ define(["require", "module"], function(require, module){
 		// Touch events support
 		has.add("touch-events", "ontouchstart" in document);
 
-		// Pointer Events support
-		has.add("pointer-events", "onpointerdown" in document);
-		has.add("MSPointer", "MSPointerEvent" in window); //IE10 (+IE11 preview)
+		// Test if pointer events are supported and enabled, with either standard names ("pointerdown" etc.) or
+		// IE specific names ("MSPointerDown" etc.).  Tests are designed to work on embedded C# WebBrowser Controls
+		// in addition to IE, Edge, and future versions of Firefox and Chrome.
+		// Note that on IE11, has("pointer-events") and has("MSPointer") are both true.
+		has.add("pointer-events", "pointerEnabled" in window.navigator ?
+				window.navigator.pointerEnabled : "PointerEvent" in window);
+		has.add("MSPointer", window.navigator.msPointerEnabled);
 
 		// I don't know if any of these tests are really correct, just a rough guess
 		has.add("device-width", screen.availWidth || innerWidth);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list