Clickable channels in chanlist applet
authorDarren <darren@darrenwhitlen.com>
Sun, 6 Oct 2013 12:15:37 +0000 (13:15 +0100)
committerDarren <darren@darrenwhitlen.com>
Sun, 6 Oct 2013 12:15:37 +0000 (13:15 +0100)
client/assets/src/applets/chanlist.js

index 0c76dd3650d2da02e215c3b649e3852c640dbe98..2e909c014fbe8ae2bf61e9bba6c238e0866dd631 100644 (file)
@@ -2,6 +2,7 @@
 \r
     var View = Backbone.View.extend({\r
         events: {\r
+            "click .chan": "chanClick",\r
         },\r
 \r
 \r
                 tbody[0].appendChild(this.channels[i].dom);\r
             }\r
             table[0].appendChild(tbody[0]);\r
+        },\r
+\r
+\r
+        chanClick: function (event) {\r
+            if (event.target) {\r
+                _kiwi.gateway.join(null, $(event.target).data('channel'));\r
+            } else {\r
+                // IE...\r
+                _kiwi.gateway.join(null, $(event.srcElement).data('channel'));\r
+            }\r
         }\r
     });\r
 \r