2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

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

is hit.
This commit is contained in:
Robin Ward 2014-02-28 13:03:05 -05:00
parent 748767e222
commit 61ff04d68b
2 changed files with 16 additions and 7 deletions

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')
});