mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
use local reference for wrap.
This commit is contained in:
parent
c07a746936
commit
b15e5b9f3d
@ -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) {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user