瀏覽代碼

Bugfix.

Controlbox always appears when page loads
JC Brand 12 年之前
父節點
當前提交
d2d10f0661
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      converse.js

+ 4 - 4
converse.js

@@ -1011,7 +1011,7 @@
             this.localStorage = new Backbone.LocalStorage(
                 hex_sha1('converse.chatboxes-'+xmppchat.bare_jid));
             if (!this.get('controlbox')) {
-                this.create({
+                this.add({
                     id: 'controlbox',
                     box_id: 'controlbox'
                 });
@@ -1022,11 +1022,11 @@
             this.get('controlbox').set({connected:true});
             // Get cached chatboxes from localstorage
             this.fetch({
-                add: true, success: 
-                $.proxy(function (collection, resp) {
+                add: true,
+                success: $.proxy(function (collection, resp) {
                     if (_.include(_.pluck(resp, 'id'), 'controlbox')) {
                         // If the controlbox was saved in localstorage, it must be visible
-                        this.get('controlbox').set({visible:true});
+                        this.get('controlbox').set({visible:true}).save();
                     }
                 }, this)
             });