diff --git a/samples/simple/index.html b/samples/simple/index.html
index ea2ea94..a838836 100644
--- a/samples/simple/index.html
+++ b/samples/simple/index.html
@@ -66,7 +66,7 @@
-
+
@@ -97,7 +97,7 @@
}
find('capture', 'output', 'enterleave');
events.forEach(function(en) {
- PolymerGestures.addGesture(capture, en, function(inEvent) {
+ PolymerGestures.addEventListener(capture, en, function(inEvent) {
appendOutput(inEvent.type + ' [' + inEvent.pointerId + ']');
inEvent.preventDefault();
});
diff --git a/src/dispatcher.js b/src/dispatcher.js
index 2b9caf3..c973b2f 100644
--- a/src/dispatcher.js
+++ b/src/dispatcher.js
@@ -321,8 +321,8 @@
scope.activateGesture = function(node, gesture) {
var dep = dispatcher.dependencyMap[gesture];
if (dep) {
+ var recognizer = dispatcher.gestures[dep.index];
if (dep.listeners === 0) {
- var recognizer = dispatcher.gestures[dep.index];
if (recognizer) {
recognizer.enabled = true;
}
@@ -332,6 +332,13 @@
dispatcher.register(node);
node._pgListeners = 0;
}
+ // TODO(dfreedm): re-evaluate bookkeeping to avoid using attributes
+ if (recognizer) {
+ var touchAction = recognizer.defaultActions && recognizer.defaultActions[gesture];
+ if (touchAction && !node.hasAttribute('touch-action')) {
+ node.setAttribute('touch-action', touchAction);
+ }
+ }
node._pgListeners++;
}
return Boolean(dep);
diff --git a/src/track.js b/src/track.js
index 86117b2..8a2827f 100644
--- a/src/track.js
+++ b/src/track.js
@@ -118,6 +118,9 @@
'track',
'trackend'
],
+ defaultActions: {
+ 'track': 'none'
+ },
WIGGLE_THRESHOLD: 4,
clampDir: function(inDelta) {
return inDelta > 0 ? 1 : -1;