Skip to content

Instantly share code, notes, and snippets.

@ppcano
Created January 11, 2012 17:01
Show Gist options
  • Select an option

  • Save ppcano/1595621 to your computer and use it in GitHub Desktop.

Select an option

Save ppcano/1595621 to your computer and use it in GitHub Desktop.
Views could have assigned its applicacion context
Em.AppGestureManager = Em.Object.extend({
_isBlocked: false,
_blockerView: null,
isBlocked: Em.computed(function(){
return this.get('_isBlocked');
}).property('_isBlocked'),
block: function( view ) {
.......
},
unblock: function( view ) {
......
},
destroy: function() {
# clean state
}
});
Em.Application.reopen({
init: function() {
this._super();
set(this, 'gestureManager', Em.AppGestureManager.create() );
},
destroy: function() {
this.get('gestureManager').destroy();
return this._super();
}
});
Em.View.reopen({
unblockGestureRecognizer: function() {
var application = get(this, 'application');
application.get('gestureManager').unblock(this);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment