Browse Source

Controlbox fix. Make sure to initialize the view again.

JC Brand 9 years ago
parent
commit
868aacb2fc
1 changed files with 10 additions and 4 deletions
  1. 10 4
      src/converse-controlbox.js

+ 10 - 4
src/converse-controlbox.js

@@ -85,10 +85,16 @@
 
             ChatBoxViews: {
                 onChatBoxAdded: function (item) {
-                    var view = this.get(item.get('id'));
-                    if (!view && item.get('box_id') === 'controlbox') {
-                        view = new converse.ControlBoxView({model: item});
-                        return this.add(item.get('id'), view);
+                    if (item.get('box_id') === 'controlbox') {
+                        var view = this.get(item.get('id'));
+                        if (view) {
+                            view.model = item;
+                            view.initialize();
+                            return view;
+                        } else {
+                            view = new converse.ControlBoxView({model: item});
+                            return this.add(item.get('id'), view);
+                        }
                     } else {
                         return this._super.onChatBoxAdded.apply(this, arguments);
                     }