1 _kiwi
.model
.PanelList
= Backbone
.Collection
.extend({
2 model
: _kiwi
.model
.Panel
,
4 comparator: function (chan
) {
5 return chan
.get('name');
7 initialize: function (elements
, network
) {
10 // If this PanelList is associated with a network/connection
12 this.network
= network
;
15 this.view
= new _kiwi
.view
.Tabs({model
: this});
17 // Holds the active panel
20 // Keep a tab on the active panel
21 this.bind('active', function (active_panel
) {
22 this.active
= active_panel
;
25 this.bind('add', function(panel
) {
26 panel
.set('panel_list', this);
32 getByCid: function (cid
) {
33 if (typeof name
!== 'string') return;
35 return this.find(function (c
) {
42 getByName: function (name
) {
43 if (typeof name
!== 'string') return;
45 return this.find(function (c
) {
46 return name
.toLowerCase() === c
.get('name').toLowerCase();