[Pkg-javascript-commits] [dojo] 06/23: Don't include time to run event handlers in 1000ms window.
David Prévot
taffit at moszumanska.debian.org
Sun Sep 14 16:23:11 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag 1.9.4
in repository dojo.
commit b28d5c1297d09296da3f3eede2ac2b52e2c86671
Author: Bill Keese <bill at dojotoolkit.org>
Date: Thu Feb 27 08:27:24 2014 +0900
Don't include time to run event handlers in 1000ms window.
In other words, ignore mousedown events that occur <1000ms after the last
touchstart handler has finished running, rather than 1000ms after the touchstart
event.
Fixes #17634.
(cherry picked from commit db467f31dc27a3eebdd3b3d43856479c2f3151c4)
---
touch.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/touch.js b/touch.js
index 5d55219..6fe896d 100644
--- a/touch.js
+++ b/touch.js
@@ -36,7 +36,14 @@ function(dojo, aspect, dom, domClass, lang, on, has, mouse, domReady, win){
}
}else if(hasTouch){
return function(node, listener){
- var handle1 = on(node, touchType, listener),
+ var handle1 = on(node, touchType, function(evt){
+ listener.call(this, evt);
+
+ // On slow mobile browsers (see https://bugs.dojotoolkit.org/ticket/17634),
+ // a handler for a touch event may take >1s to run. That time shouldn't
+ // be included in the calculation for lastTouch.
+ lastTouch = (new Date()).getTime();
+ }),
handle2 = on(node, mouseType, function(evt){
if(!lastTouch || (new Date()).getTime() > lastTouch + 1000){
listener.call(this, evt);
--
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