Remove data setting from render function in chanlist
authorCory Chaplin <cory.chaplin@laposte.net>
Thu, 27 Mar 2014 16:15:39 +0000 (17:15 +0100)
committerCory Chaplin <cory.chaplin@laposte.net>
Thu, 27 Mar 2014 16:15:39 +0000 (17:15 +0100)
client/src/applets/chanlist.js

index c85bba83aa76f061a17dab90887f1f2295b3739e..9c9cccb71d67c247af634f7e1205a4ca38346586 100644 (file)
@@ -27,7 +27,7 @@
             this.waiting = false;\r
         },\r
 \r
-        render: function (override_channels) {\r
+        render: function () {\r
             var table = $('table', this.$el),\r
                 tbody = table.children('tbody:first').detach(),\r
                 that = this,\r
             \r
             this.sorting_channels = false;\r
             \r
-            if (override_channels !== undefined) {\r
-                that.channels = override_channels;\r
-                tbody.remove();\r
-                this.sorting_channels = true;\r
-            } else {\r
-                this.channels = this.sortChannels(this.channels, this.order);\r
-            }\r
+            this.channels = this.sortChannels(this.channels, this.order);\r
 \r
             // Create the sort icon container and clean previous any previous ones\r
             if($('.applet_chanlist .users_title').find('span.chanlist_sort_users').length == 0) {\r
         },\r
         \r
         sortChannelsClick: function(order) {\r
-            var that = this,\r
-                channels = this.sortChannels(that.channels, order);\r
+            this.channels = this.sortChannels(this.channels, order);\r
 \r
-            this.render(channels);\r
+            this.render();\r
         },\r
         \r
         sortChannels: function (channels, order) {\r