1 _kiwi
.model
.Panel
= Backbone
.Model
.extend({
2 initialize: function (attributes
) {
3 var name
= this.get("name") || "";
4 this.view
= new _kiwi
.view
.Panel({"model": this, "name": name
});
11 closePanel: function () {
15 this.view
= undefined;
19 var members
= this.get('members');
22 this.unset('members');
25 this.get('panel_list').remove(this);
30 // If closing the active panel, switch to the server panel
31 if (this === _kiwi
.app
.panels().active
) {
32 _kiwi
.app
.connections
.active_connection
.panels
.server
.view
.show();
36 // Alias to closePanel() for child objects to override
38 return this.closePanel();
41 isChannel: function () {
42 var channel_prefix
= _kiwi
.gateway
.get('channel_prefix'),
43 this_name
= this.get('name');
45 if (this.isApplet() || !this_name
) return false;
46 return (channel_prefix
.indexOf(this_name
[0]) > -1);
49 isQuery: function () {
50 if (!this.isChannel() && !this.isApplet() && !this.isServer()) {
57 isApplet: function () {
58 return this.applet
? true : false;
61 isServer: function () {
62 return this.server
? true : false;
65 isActive: function () {
66 return (_kiwi
.app
.panels().active
=== this);