use local reference for wrap.

This commit is contained in:
Steven Orvell 2015-11-11 18:13:30 -08:00
parent c07a746936
commit b15e5b9f3d
2 changed files with 6 additions and 4 deletions

View File

@ -60,7 +60,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
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) {

View File

@ -12,6 +12,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
'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 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
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 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
// 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 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
// 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;