From b15e5b9f3d1f38c321a96f5f8076e46f97435b7d Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Wed, 11 Nov 2015 18:13:30 -0800 Subject: [PATCH] use local reference for wrap. --- src/lib/dom-api.html | 2 +- src/standard/gestures.html | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/dom-api.html b/src/lib/dom-api.html index 36a4e8368c..53f7447bf5 100644 --- a/src/lib/dom-api.html +++ b/src/lib/dom-api.html @@ -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) { diff --git a/src/standard/gestures.html b/src/standard/gestures.html index 735b0cb072..b4105ce5ce 100644 --- a/src/standard/gestures.html +++ b/src/standard/gestures.html @@ -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'; @@ -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; @@ -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; @@ -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;