Skip to content

Commit

Permalink
use local reference for wrap.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed Nov 12, 2015
1 parent c07a746 commit b15e5b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/dom-api.html
Expand Up @@ -60,7 +60,7 @@

var n = node;
// wrap document for SD polyfill
var wrappedDocument = Polymer.DomApi.wrap(document);
var wrappedDocument = wrap(document);

// walk from node to `this` or `document`
while (n && n !== wrappedDocument && n !== this.node) {
Expand Down
8 changes: 5 additions & 3 deletions src/standard/gestures.html
Expand Up @@ -12,6 +12,8 @@

'use strict';

var wrap = Polymer.DomApi.wrap;

// detect native touch action support
var HAS_NATIVE_TA = typeof document.head.style.touchAction === 'string';
var GESTURE_KEY = '__polymerGestures';
Expand Down Expand Up @@ -199,7 +201,7 @@
handleNative: function(ev) {
var handled;
var type = ev.type;
var node = Polymer.DomApi.wrap(ev.currentTarget);
var node = wrap(ev.currentTarget);
var gobj = node[GESTURE_KEY];
if (!gobj) {
return;
Expand Down Expand Up @@ -296,7 +298,7 @@
// automate the event listeners for the native events
add: function(node, evType, handler) {
// SD polyfill: handle case where `node` is unwrapped, like `document`
node = Polymer.DomApi.wrap(node);
node = wrap(node);
var recognizer = this.gestures[evType];
var deps = recognizer.deps;
var name = recognizer.name;
Expand Down Expand Up @@ -329,7 +331,7 @@
// automate event listener removal for native events
remove: function(node, evType, handler) {
// SD polyfill: handle case where `node` is unwrapped, like `document`
node = Polymer.DomApi.wrap(node);
node = wrap(node);
var recognizer = this.gestures[evType];
var deps = recognizer.deps;
var name = recognizer.name;
Expand Down

0 comments on commit b15e5b9

Please sign in to comment.