Created
January 11, 2012 17:01
-
-
Save ppcano/1595621 to your computer and use it in GitHub Desktop.
Views could have assigned its applicacion context
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Em.Application.reopen({ | |
| init: function() { | |
| this._super(); | |
| set(this, 'gestureManager', Em.AppGestureManager.create() ); | |
| }, | |
| destroy: function() { | |
| this.get('gestureManager').destroy(); | |
| return this._super(); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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