From c891916bc1b47acc9bfdfe3d35d7443960344492 Mon Sep 17 00:00:00 2001 From: Darren Date: Fri, 4 Jul 2014 16:28:40 +0100 Subject: [PATCH] Better use of inherited panels --- client/src/models/applet.js | 3 ++- client/src/models/panel.js | 7 +------ 2 files changed, 3 insertions(+), 7 deletions(-) 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; }, -- 2.25.1