Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Merge pull request #51 from Polymer/ergo-gesture
Browse files Browse the repository at this point in the history
Use the new per-element gesture registration
  • Loading branch information
dfreedm committed Jul 16, 2014
2 parents a14c2ef + 3f132ef commit 287de28
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/declaration/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@

return function(model, node, oneTime) {
var handler = events.getEventHandler(undefined, node, pathString);
PolymerGestures.addGesture(node, eventType);
node.addEventListener(eventType, handler);

if (oneTime)
Expand All @@ -101,6 +102,7 @@
open: bindingValue,
discardChanges: bindingValue,
close: function() {
PolymerGestures.removeGesture(node, eventType);
node.removeEventListener(eventType, handler);
}
};
Expand Down
2 changes: 0 additions & 2 deletions src/instance/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,6 @@
shadowRootReady: function(root) {
// locate nodes with id and store references to them in this.$ hash
this.marshalNodeReferences(root);
// set up polymer gestures
PolymerGestures.register(root);
},
// locate nodes with id and store references to them in this.$ hash
marshalNodeReferences: function(root) {
Expand Down
1 change: 1 addition & 0 deletions src/instance/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
// by default supports 1 thing being bound.
for (var type in events) {
var methodName = events[type];
PolymerGestures.addGesture(this, type);
this.addEventListener(type, this.element.getEventHandler(this, this,
methodName));
}
Expand Down

0 comments on commit 287de28

Please sign in to comment.