From: Darren Date: Sun, 2 Sep 2012 12:38:35 +0000 (+0100) Subject: `that` global leak cleanup X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b17c50d52cba7e642655387977ac96b5f003a1ef;p=KiwiIRC.git `that` global leak cleanup --- diff --git a/client_backbone/dev/model.js b/client_backbone/dev/model.js index 59af6d3..9c4c665 100644 --- a/client_backbone/dev/model.js +++ b/client_backbone/dev/model.js @@ -304,8 +304,7 @@ kiwi.model.Server = kiwi.model.Panel.extend({ // TODO: Listen to gateway events for anythign related to this channel kiwi.model.Channel = kiwi.model.Panel.extend({ initialize: function (attributes) { - var that = this, - name = this.get("name") || "", + var name = this.get("name") || "", members; this.view = new kiwi.view.Channel({"model": this, "name": name}); diff --git a/client_backbone/dev/view.js b/client_backbone/dev/view.js index b88a4c0..1c25b16 100644 --- a/client_backbone/dev/view.js +++ b/client_backbone/dev/view.js @@ -366,11 +366,10 @@ kiwi.view.ControlBox = Backbone.View.extend({ }, initialize: function () { - var cb = this; // TODO: Why is `that` not recognised in the below closure? - that = this; + var that = this; kiwi.gateway.bind('change:nick', function () { - $('.nick', cb.$el).text(this.get('nick')); + $('.nick', that.$el).text(this.get('nick')); }); },