Remove "Joining channel..." properly when show joins/parts is off.
authorJack Allnutt <m2ys4u@gmail.com>
Mon, 20 May 2013 01:44:37 +0000 (02:44 +0100)
committerJack Allnutt <m2ys4u@gmail.com>
Mon, 20 May 2013 01:44:37 +0000 (02:44 +0100)
Fixes #249

client/assets/dev/model_channel.js

index 10669a50c7ad1f814b9023644bde4aee1780e674..aca182b95c8a0f7f13f254e6bb76fd6ede63729b 100644 (file)
@@ -3,7 +3,8 @@
 _kiwi.model.Channel = _kiwi.model.Panel.extend({\r
     initialize: function (attributes) {\r
         var name = this.get("name") || "",\r
-            members;\r
+            members,\r
+            that = this;\r
 \r
         this.view = new _kiwi.view.Channel({"model": this, "name": name});\r
         this.set({\r
@@ -18,9 +19,15 @@ _kiwi.model.Channel = _kiwi.model.Panel.extend({
         members.bind("add", function (member) {\r
             var show_message = _kiwi.global.settings.get('show_joins_parts');\r
             if (show_message === false) {\r
+                // TODO: This might be better off being moved to the view at some point.\r
+                if (member.get('nick') === that.collection.network.get('nick')) {\r
+                    this.view.$el.find('.initial_loader').slideUp(function () {\r
+                        $(this).remove();\r
+                    });\r
+                }\r
                 return;\r
             }\r
-            \r
+\r
             this.addMsg(' ', '== ' + member.displayNick(true) + ' has joined', 'action join');\r
         }, this);\r
 \r