Ver Fonte

Make sure `show` is created on all chatbox types

JC Brand há 7 anos atrás
pai
commit
6cce931086
3 ficheiros alterados com 10 adições e 8 exclusões
  1. 7 4
      src/converse-chatview.js
  2. 2 2
      src/converse-headline.js
  3. 1 2
      src/converse-muc-views.js

+ 7 - 4
src/converse-chatview.js

@@ -256,10 +256,7 @@
                 },
 
                 initialize () {
-                    this.scrollDown = _.debounce(this._scrollDown, 250);
-                    this.markScrolled = _.debounce(this._markScrolled, 100);
-                    this.show = _.debounce(this._show, 250, {'leading': true});
-
+                    this.initDebounced();
 
                     this.createEmojiPicker();
                     this.model.messages.on('add', this.onMessageAdded, this);
@@ -276,6 +273,12 @@
                     _converse.emit('chatBoxInitialized', this);
                 },
 
+                initDebounced () {
+                    this.scrollDown = _.debounce(this._scrollDown, 250);
+                    this.markScrolled = _.debounce(this._markScrolled, 100);
+                    this.show = _.debounce(this._show, 250, {'leading': true});
+                },
+
                 render () {
                     // XXX: Is this still needed?
                     this.el.setAttribute('id', this.model.get('box_id'));

+ 2 - 2
src/converse-headline.js

@@ -93,8 +93,8 @@
                 },
 
                 initialize () {
-                    this.scrollDown = _.debounce(this._scrollDown, 250);
-                    this.markScrolled = _.debounce(this._markScrolled, 100);
+                    this.initDebounced();
+
                     this.disable_mam = true; // Don't do MAM queries for this box
                     this.model.messages.on('add', this.onMessageAdded, this);
                     this.model.on('show', this.show, this);

+ 1 - 2
src/converse-muc-views.js

@@ -507,8 +507,7 @@
                 },
 
                 initialize () {
-                    this.scrollDown = _.debounce(this._scrollDown, 250);
-                    this.markScrolled = _.debounce(this._markScrolled, 100);
+                    this.initDebounced();
 
                     this.model.messages.on('add', this.onMessageAdded, this);
                     this.model.messages.on('rendered', this.scrollDown, this);