From b0ec0c58144b74619c10a8fd3833ef53b5038b9d Mon Sep 17 00:00:00 2001 From: Darren Date: Thu, 3 Jul 2014 23:40:17 +0100 Subject: [PATCH] Only open 1 query panel per user from userbox --- client/src/views/userbox.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/src/views/userbox.js b/client/src/views/userbox.js index 8d21445..8494629 100644 --- a/client/src/views/userbox.js +++ b/client/src/views/userbox.js @@ -44,8 +44,14 @@ _kiwi.view.UserBox = Backbone.View.extend({ }, queryClick: function (event) { - var panel = new _kiwi.model.Query({name: this.user.get('nick')}); - _kiwi.app.connections.active_connection.panels.add(panel); + var nick = this.user.get('nick'), + panel = _kiwi.app.connections.active_connection.panels.getByName(nick); + + if (!panel) { + panel = new _kiwi.model.Query({name: nick}); + _kiwi.app.connections.active_connection.panels.add(panel); + } + panel.view.show(); }, -- 2.25.1