Skip to content

Commit

Permalink
feat(gestures): support disabling all gestures
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasBurleson committed Sep 5, 2017
1 parent 2e76e10 commit effe15d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/services/gesture/gesture.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ var HANDLERS = {};
* as well as other information abstracted from the DOM.
*/

var pointer, lastPointer, forceSkipClickHijack = false, maxClickDistance = 6;
var pointer, lastPointer, maxClickDistance = 6;
var forceSkipClickHijack = false, disableAllGestures = false;

/**
* The position of the most recent click if that click was on a label element.
Expand Down Expand Up @@ -52,6 +53,11 @@ function MdGestureProvider() { }

MdGestureProvider.prototype = {

disableAll : function() {
debugger;
disableAllGestures = true;
},

// Publish access to setter to configure a variable BEFORE the
// $mdGesture service is instantiated...
skipClickHijack: function() {
Expand Down Expand Up @@ -510,6 +516,7 @@ function MdGestureHandler() {
* @ngInject
*/
function attachToDocument( $mdGesture, $$MdGestureHandler ) {
if ( disableAllGestures ) return;

// Polyfill document.contains for IE11.
// TODO: move to util
Expand Down

0 comments on commit effe15d

Please sign in to comment.