\r
\r
dispose: function () {\r
+ console.log("Dispose oooooo");\r
this.view.channels = null;\r
this.view.unbind();\r
this.view.$el.html('');\r
\r
this.resize_handle = new _kiwi.view.ResizeHandler({el: this.view.$el.find('.memberlists_resize_handle')[0]});\r
\r
+ this.panel_access = new Array();\r
+\r
// Rejigg the UI sizes\r
this.view.doLayout();\r
};\r
},\r
\r
closePanel: function () {\r
+ console.log("Closing panel");\r
if (this.view) {\r
this.view.unbind();\r
this.view.remove();\r
this.unbind();\r
this.destroy();\r
\r
- // If closing the active panel, switch to the server panel\r
+ // If closing the active panel, switch to the last-accessed panel\r
if (this === _kiwi.app.panels().active) {\r
- _kiwi.app.connections.active_connection.panels.server.view.show();\r
+ _kiwi.app.panel_access.shift();\r
+\r
+ var modelsList = _kiwi.app.connections.active_connection.panels.models;\r
+ //Since it always has at least one tab, just go to the 0th element\r
+ for (var i=0; i < modelsList.length;i++) {\r
+ if (modelsList[i].cid === _kiwi.app.panel_access[0]) {\r
+ console.log("Yap");\r
+ modelsList[i].view.show();\r
+ }\r
+ }\r
}\r
},\r
\r
networkRemoved: function(network) {
network.panels.view.remove();
-
+ console.log("networkRemoved");
+ console.log(network);
_kiwi.app.view.doLayout();
}
});
\ No newline at end of file
panelRemoved: function (panel) {
panel.tab.remove();
delete panel.tab;
-
_kiwi.app.view.doLayout();
},
if (!panel.isServer()) {
panel.tab.append('<span class="part icon-nonexistant"></span>');
}
+
+ var panel_index = _kiwi.app.panel_access.indexOf(panel.cid);
+
+ if (panel_index > -1) {
+ _kiwi.app.panel_access.splice(panel_index, 1);
+ }
+
+ //Make this panel the most recently accessed
+ _kiwi.app.panel_access.unshift(panel.cid);
+
},
tabClick: function (e) {