From: Cory Chaplin Date: Wed, 16 Jul 2014 07:38:15 +0000 (+0200) Subject: Allow plugins to create queries X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=dabf8ed970c8cb43529cbc99f9be8ece34d4d8f2;p=KiwiIRC.git Allow plugins to create queries --- diff --git a/client/src/models/network.js b/client/src/models/network.js index b2fbb3c..13d0359 100644 --- a/client/src/models/network.js +++ b/client/src/models/network.js @@ -233,6 +233,22 @@ } return false; + }, + + // Create a new query panel + createQuery: function (nick) { + var that = this, + panels = []; + + // Check if we have the panel already. If not, create it + query = that.panels.getByName(nick); + if (!query) { + query = new _kiwi.model.Query({name: nick}); + that.panels.add(query); + } + + // In all cases, show the demanded query + that.panels.getByName(nick).view.show(); } });