Commit 08fc0823 authored by JC Brand's avatar JC Brand

More scrolling improvements

parent ad1d5c6c
...@@ -135,8 +135,8 @@ ...@@ -135,8 +135,8 @@
}, },
afterMessagesFetched: function () { afterMessagesFetched: function () {
this.scrollDown();
this.insertIntoDOM(); this.insertIntoDOM();
this.scrollDown();
// We only start listening for the scroll event after // We only start listening for the scroll event after
// cached messages have been fetched // cached messages have been fetched
this.$content.on('scroll', this.markScrolled.bind(this)); this.$content.on('scroll', this.markScrolled.bind(this));
...@@ -155,7 +155,10 @@ ...@@ -155,7 +155,10 @@
/* This method gets overridden in src/converse-controlbox.js if /* This method gets overridden in src/converse-controlbox.js if
* the controlbox plugin is active. * the controlbox plugin is active.
*/ */
$('#conversejs').prepend(this.$el); var container = document.querySelector('#conversejs');
if (this.el.parentNode !== container) {
container.insertBefore(this.el, container.firstChild);
}
return this; return this;
}, },
...@@ -821,7 +824,7 @@ ...@@ -821,7 +824,7 @@
* instance, so that we have it debounced per instance. * instance, so that we have it debounced per instance.
* Debouncing it on the class-level is too broad. * Debouncing it on the class-level is too broad.
*/ */
this.debouncedScrollDown = _.debounce(this._scrollDown, 250, {'leading': true}); this.debouncedScrollDown = _.debounce(this._scrollDown, 250);
} }
this.debouncedScrollDown.apply(this, arguments); this.debouncedScrollDown.apply(this, arguments);
return this; return this;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment