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:
parent
748767e222
commit
61ff04d68b
2 changed files with 16 additions and 7 deletions
11
vendor/assets/javascripts/ember-cloaking.js
vendored
11
vendor/assets/javascripts/ember-cloaking.js
vendored
|
@ -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')
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue