Allow plugins to create queries
authorCory Chaplin <cory.chaplin@laposte.net>
Wed, 16 Jul 2014 07:38:15 +0000 (09:38 +0200)
committerCory Chaplin <cory.chaplin@laposte.net>
Wed, 16 Jul 2014 07:38:15 +0000 (09:38 +0200)
client/src/models/network.js

index b2fbb3cf1260d5d3487d38d780cc945c0a155d48..13d0359765249147ce1111a352077ba23b3fca21 100644 (file)
             }
 
             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();
         }
     });