3 changes

- immediately show chat box (sometimes fetching features takes long)
- add timeout for fetching features
- don't register scroll handler twice for chat rooms.
This commit is contained in:
JC Brand 2017-02-28 17:25:33 +00:00
parent 2c88545b28
commit dc8cbc6104

View File

@ -352,7 +352,7 @@
this.model.on('change:name', this.renderHeading, this);
this.createOccupantsView();
this.render();
this.render().insertIntoDOM();
this.registerHandlers();
if (this.model.get('connection_status') !== ROOMSTATUS.ENTERED) {
@ -458,13 +458,6 @@
}
},
afterMessagesFetched: function () {
_converse.ChatBoxView.prototype.afterMessagesFetched.apply(this, arguments);
// We only start listening for the scroll event after
// cached messages have been fetched
this.$('.chat-content').on('scroll', this.markScrolled.bind(this));
},
getExtraMessageClasses: function (attrs) {
var extra_classes = _converse.ChatBoxView.prototype
.getExtraMessageClasses.apply(this, arguments);
@ -1395,7 +1388,8 @@
that.model.save(features);
return deferred.resolve();
},
deferred.reject
deferred.reject,
5000
);
return deferred.promise();
},