From 879348071b03ade0f6282eb8103ae4f0154a4ca6 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Thu, 26 Sep 2013 13:03:31 -0500 Subject: [PATCH] only allow Tap gesture to be added for window --- dist/ionic.js | 12 +++++++++--- js/gestures.js | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/dist/ionic.js b/dist/ionic.js index 0dda6d3954..be6162c17a 100644 --- a/dist/ionic.js +++ b/dist/ionic.js @@ -293,9 +293,15 @@ if ( document.readyState === "complete" ) { ionic.Gestures.event.determineEventTypes(); // Register all gestures inside ionic.Gestures.gestures - for(var name in ionic.Gestures.gestures) { - if(ionic.Gestures.gestures.hasOwnProperty(name)) { - ionic.Gestures.detection.register(ionic.Gestures.gestures[name]); + if(this === this.window) { + // this is a window, then only allow the Tap gesture to be added + ionic.Gestures.detection.register(ionic.Gestures.gestures.Tap); + } else { + // everything else but the window + for(var name in ionic.Gestures.gestures) { + if(ionic.Gestures.gestures.hasOwnProperty(name)) { + ionic.Gestures.detection.register(ionic.Gestures.gestures[name]); + } } } diff --git a/js/gestures.js b/js/gestures.js index 7dbb356e2e..e836e94232 100644 --- a/js/gestures.js +++ b/js/gestures.js @@ -90,9 +90,15 @@ ionic.Gestures.event.determineEventTypes(); // Register all gestures inside ionic.Gestures.gestures - for(var name in ionic.Gestures.gestures) { - if(ionic.Gestures.gestures.hasOwnProperty(name)) { - ionic.Gestures.detection.register(ionic.Gestures.gestures[name]); + if(this === this.window) { + // this is a window, then only allow the Tap gesture to be added + ionic.Gestures.detection.register(ionic.Gestures.gestures.Tap); + } else { + // everything else but the window + for(var name in ionic.Gestures.gestures) { + if(ionic.Gestures.gestures.hasOwnProperty(name)) { + ionic.Gestures.detection.register(ionic.Gestures.gestures[name]); + } } }