Removed horizontal divider from bottom of userbox
[KiwiIRC.git] / client / assets / dev / model_panellist.js
index f16df71361a681fbe46e489ffe7b2bb6aed0dac7..220f142d2021c7ba2d4138ce7f947c87c8cab930 100644 (file)
@@ -1,15 +1,18 @@
-kiwi.model.PanelList = Backbone.Collection.extend({\r
-    model: kiwi.model.Panel,\r
+_kiwi.model.PanelList = Backbone.Collection.extend({\r
+    model: _kiwi.model.Panel,\r
 \r
     comparator: function (chan) {\r
-        return chan.get("name");\r
+        return chan.get('name');\r
     },\r
-    initialize: function () {\r
-        this.view = new kiwi.view.Tabs({"el": $('#tabs')[0], "model": this});\r
+    initialize: function (elements, network) {\r
+        var that = this;\r
 \r
-        // Automatically create a server tab\r
-        this.add(new kiwi.model.Server({'name': kiwi.gateway.get('name')}));\r
-        this.server = this.getByName(kiwi.gateway.get('name'));\r
+        // If this PanelList is associated with a network/connection\r
+        if (network) {\r
+            this.network = network;\r
+        }\r
+\r
+        this.view = new _kiwi.view.Tabs({model: this});\r
 \r
         // Holds the active panel\r
         this.active = null;\r
@@ -19,11 +22,28 @@ kiwi.model.PanelList = Backbone.Collection.extend({
             this.active = active_panel;\r
         }, this);\r
 \r
+        this.bind('add', function(panel) {\r
+            panel.set('panel_list', this);\r
+        });\r
+    },\r
+\r
+\r
+\r
+    getByCid: function (cid) {\r
+        if (typeof name !== 'string') return;\r
+\r
+        return this.find(function (c) {\r
+            return cid === c.cid;\r
+        });\r
     },\r
+\r
+\r
+\r
     getByName: function (name) {\r
         if (typeof name !== 'string') return;\r
+\r
         return this.find(function (c) {\r
             return name.toLowerCase() === c.get('name').toLowerCase();\r
         });\r
     }\r
-});
\ No newline at end of file
+});\r