From: Darren Date: Fri, 4 Jul 2014 15:28:40 +0000 (+0100) Subject: Better use of inherited panels X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c891916bc1b47acc9bfdfe3d35d7443960344492;p=KiwiIRC.git Better use of inherited panels --- diff --git a/client/src/models/applet.js b/client/src/models/applet.js index 0175791..0660b13 100644 --- a/client/src/models/applet.js +++ b/client/src/models/applet.js @@ -76,7 +76,8 @@ _kiwi.model.Applet = _kiwi.model.Panel.extend({ this.loaded_applet.dispose(); } - this.closePanel(); + // Call the inherited close() + this.constructor.__super__.close.apply(this, arguments); }, isApplet: function () { diff --git a/client/src/models/panel.js b/client/src/models/panel.js index e3f15ca..1f77ad0 100644 --- a/client/src/models/panel.js +++ b/client/src/models/panel.js @@ -10,7 +10,7 @@ _kiwi.model.Panel = Backbone.Model.extend({ _kiwi.global.events.emit('panel:created', {panel: this}); }, - closePanel: function () { + close: function () { _kiwi.global.events.emit('panel:close', {panel: this}); if (this.view) { @@ -32,11 +32,6 @@ _kiwi.model.Panel = Backbone.Model.extend({ this.destroy(); }, - // Alias to closePanel() for child objects to override - close: function () { - return this.closePanel(); - }, - isChannel: function () { return false; },