Polishing join-fix
authorDarren <darren@darrenwhitlen.com>
Sat, 25 May 2013 18:29:06 +0000 (19:29 +0100)
committerDarren <darren@darrenwhitlen.com>
Sat, 25 May 2013 18:29:06 +0000 (19:29 +0100)
client/assets/src/models/channel.js
client/assets/src/views/channel.js

index 965c7106b0607dd616a74bebf7d88dc08926cc16..8e90c83ceb3da891f4d6313a3b8b15e68383ca94 100644 (file)
@@ -3,10 +3,8 @@
 _kiwi.model.Channel = _kiwi.model.Panel.extend({\r
     initialize: function (attributes) {\r
         var name = this.get("name") || "",\r
-            members,\r
-            that = this;\r
+            members;\r
 \r
-        this.view = new _kiwi.view.Channel({"model": this, "name": name});\r
         this.set({\r
             "members": new _kiwi.model.MemberList(),\r
             "name": name,\r
@@ -14,6 +12,8 @@ _kiwi.model.Channel = _kiwi.model.Panel.extend({
             "topic": ""\r
         }, {"silent": true});\r
 \r
+        this.view = new _kiwi.view.Channel({"model": this, "name": name});\r
+\r
         members = this.get("members");\r
         members.channel = this;\r
         members.bind("add", function (member) {\r
index d0dc91a56c842810dda3c795acc5f6c9ac2676e2..3c84ead576cefd712f85570c8483f56aff7a10f8 100644 (file)
@@ -15,8 +15,8 @@ _kiwi.view.Channel = _kiwi.view.Panel.extend({
         this.model.bind('change:topic', this.topic, this);
 
         this.model.get('members').bind('add', function (member) {
-            if (member.get('nick') === that.collection.network.get('nick')) {
-                this.view.$el.find('.initial_loader').slideUp(function () {
+            if (member.get('nick') === this.model.collection.network.get('nick')) {
+                this.$el.find('.initial_loader').slideUp(function () {
                     $(this).remove();
                 });
             }