Upgrade ember-cloaking to not trigger scroll events when the back button

is hit.
This commit is contained in:
Robin Ward
2014-02-28 15:35:45 -05:00
parent 748767e222
commit 61ff04d68b
2 changed files with 16 additions and 7 deletions
+10 -1
View File
@@ -95,6 +95,8 @@
@method scrolled
**/
scrolled: function() {
if (!this.get('scrollingEnabled')) { return; }
var childViews = this.get('childViews');
if ((!childViews) || (childViews.length === 0)) { return; }
@@ -189,11 +191,18 @@
$(window).bind('scroll.ember-cloak', onScrollMethod);
this.addObserver('wrapperTop', self, onScrollMethod);
this.addObserver('wrapperHeight', self, onScrollMethod);
this.set('scrollingEnabled', true);
}.on('didInsertElement'),
_endEvents: function() {
cleanUp: function() {
$(document).unbind('touchmove.ember-cloak');
$(window).unbind('scroll.ember-cloak');
this.set('scrollingEnabled', false);
},
_endEvents: function() {
this.cleanUp();
}.on('willDestroyElement')
});