Fix up editor/preview scroll and post list loading

Refs #5381
- Invoke this._super() so mixed in lifecycle hooks run.
This commit is contained in:
Jason Williams 2015-06-22 11:35:17 -05:00
parent 564d64bac4
commit 78361c25af
4 changed files with 14 additions and 0 deletions

View File

@ -28,6 +28,8 @@ Editor = Ember.TextArea.extend(EditorAPI, EditorShortcuts, EditorScroll, {
* Sets up properties at render time * Sets up properties at render time
*/ */
didInsertElement: function () { didInsertElement: function () {
this._super();
this.setFocus(); this.setFocus();
this.sendAction('setEditor', this); this.sendAction('setEditor', this);

View File

@ -91,10 +91,14 @@ var EditorScroll = Ember.Mixin.create({
}, },
didInsertElement: function () { didInsertElement: function () {
this._super();
this.attachScrollHandlers(); this.attachScrollHandlers();
}, },
willDestroyElement: function () { willDestroyElement: function () {
this._super();
this.detachScrollHandlers(); this.detachScrollHandlers();
} }
}); });

View File

@ -34,10 +34,14 @@ var PaginationViewInfiniteScrollMixin = Ember.Mixin.create({
}, },
didInsertElement: function () { didInsertElement: function () {
this._super();
this.attachCheckScroll(); this.attachCheckScroll();
}, },
willDestroyElement: function () { willDestroyElement: function () {
this._super();
// unbind from the scroll event when the element is no longer in the DOM // unbind from the scroll event when the element is no longer in the DOM
this.$().off('scroll'); this.$().off('scroll');
} }

View File

@ -15,10 +15,14 @@ var PaginatedScrollBox = Ember.View.extend(PaginationViewMixin, {
}, },
didInsertElement: function () { didInsertElement: function () {
this._super();
this.attachScrollClassHandler(); this.attachScrollClassHandler();
}, },
willDestroyElement: function () { willDestroyElement: function () {
this._super();
// removes scroll class handler event // removes scroll class handler event
this.$().off('scroll'); this.$().off('scroll');
} }