Commit 7ff99a50 authored by JC Brand's avatar JC Brand

Only need a reference to the toggle view

parent d45ba9e5
...@@ -2690,8 +2690,9 @@ ...@@ -2690,8 +2690,9 @@
}, },
initialize: function () { initialize: function () {
this.chats_toggle = new converse.MinimizedChatsToggle(); this.toggleview = new converse.MinimizedChatsToggleView({
this.chats_toggle_view = new converse.MinimizedChatsToggleView({model: this.chats_toggle}); model: new converse.MinimizedChatsToggle()
});
this.model.on("add", function (item) { this.model.on("add", function (item) {
if (item.get('minimized')) { if (item.get('minimized')) {
...@@ -2716,7 +2717,7 @@ ...@@ -2716,7 +2717,7 @@
}, },
toggle: function () { toggle: function () {
this.chats_toggle.set({'visible': !this.chats_toggle.get('visible')}) this.toggleview.model.set({'visible': !this.toggleview.model.get('visible')})
this.$('.minimized-chats-flyout').toggle(); this.$('.minimized-chats-flyout').toggle();
}, },
...@@ -2736,13 +2737,13 @@ ...@@ -2736,13 +2737,13 @@
var view = new converse.MinimizedChatBoxView({model: item}); var view = new converse.MinimizedChatBoxView({model: item});
this.$('.minimized-chats-flyout').append(view.render()); this.$('.minimized-chats-flyout').append(view.render());
this.add(item.get('id'), view); this.add(item.get('id'), view);
this.chats_toggle.set({'num_minimized': this.keys().length}); this.toggleview.model.set({'num_minimized': this.keys().length});
this.render(); this.render();
}, },
removeChat: function (item) { removeChat: function (item) {
this.remove(item.get('id')); this.remove(item.get('id'));
this.chats_toggle.set({'num_minimized': this.keys().length}); this.toggleview.model.set({'num_minimized': this.keys().length});
this.render(); this.render();
} }
}); });
......
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