Commit d2d10f06 authored by JC Brand's avatar JC Brand

Bugfix.

Controlbox always appears when page loads
parent ebfd092e
......@@ -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)
});
......
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