`that` global leak cleanup
authorDarren <darren@darrenwhitlen.com>
Sun, 2 Sep 2012 12:38:35 +0000 (13:38 +0100)
committerDarren <darren@darrenwhitlen.com>
Sun, 2 Sep 2012 12:38:35 +0000 (13:38 +0100)
client_backbone/dev/model.js
client_backbone/dev/view.js

index 59af6d3af4794024cf6855004096e5a9f87994eb..9c4c6656ca1dab7a598787f48cc29ca49f1b88ee 100644 (file)
@@ -304,8 +304,7 @@ kiwi.model.Server = kiwi.model.Panel.extend({
 // TODO: Listen to gateway events for anythign related to this channel\r
 kiwi.model.Channel = kiwi.model.Panel.extend({\r
     initialize: function (attributes) {\r
-        var that = this,\r
-            name = this.get("name") || "",\r
+        var name = this.get("name") || "",\r
             members;\r
 \r
         this.view = new kiwi.view.Channel({"model": this, "name": name});\r
index b88a4c05af8bed5563b49e180d3e8b14fa380714..1c25b1653859a186f5cfd0db6346d7a5d4fb0df4 100644 (file)
@@ -366,11 +366,10 @@ kiwi.view.ControlBox = Backbone.View.extend({
     },\r
 \r
     initialize: function () {\r
-        var cb = this; // TODO: Why is `that` not recognised in the below closure?\r
-        that = this;\r
+        var that = this;\r
 \r
         kiwi.gateway.bind('change:nick', function () {\r
-            $('.nick', cb.$el).text(this.get('nick'));\r
+            $('.nick', that.$el).text(this.get('nick'));\r
         });\r
     },\r
 \r