Better use of inherited panels
authorDarren <darren@darrenwhitlen.com>
Fri, 4 Jul 2014 15:28:40 +0000 (16:28 +0100)
committerDarren <darren@darrenwhitlen.com>
Fri, 4 Jul 2014 15:28:40 +0000 (16:28 +0100)
client/src/models/applet.js
client/src/models/panel.js

index 0175791acf9c43a901cbfdbf59fb823c5149ea3d..0660b13ef3b746f9f2ad890961f7e1d8382641be 100644 (file)
@@ -76,7 +76,8 @@ _kiwi.model.Applet = _kiwi.model.Panel.extend({
             this.loaded_applet.dispose();\r
         }\r
 \r
-        this.closePanel();\r
+        // Call the inherited close()\r
+        this.constructor.__super__.close.apply(this, arguments);\r
     },\r
 \r
     isApplet: function () {\r
index e3f15caf2f36e1128560d0460c20f6a985f4498f..1f77ad072e3b0c442a980af22ee38fbcc408cb02 100644 (file)
@@ -10,7 +10,7 @@ _kiwi.model.Panel = Backbone.Model.extend({
         _kiwi.global.events.emit('panel:created', {panel: this});\r
     },\r
 \r
-    closePanel: function () {\r
+    close: function () {\r
         _kiwi.global.events.emit('panel:close', {panel: this});\r
 \r
         if (this.view) {\r
@@ -32,11 +32,6 @@ _kiwi.model.Panel = Backbone.Model.extend({
         this.destroy();\r
     },\r
 \r
-    // Alias to closePanel() for child objects to override\r
-    close: function () {\r
-        return this.closePanel();\r
-    },\r
-\r
     isChannel: function () {\r
         return false;\r
     },\r