Tab shortbut keys working again
authorDarren <darren@Darrens-MacBook-Pro.local>
Sun, 21 Apr 2013 15:18:56 +0000 (16:18 +0100)
committerDarren <darren@Darrens-MacBook-Pro.local>
Sun, 21 Apr 2013 15:18:56 +0000 (16:18 +0100)
client/assets/dev/view.js

index 23bd6f7c9f6aa5dbbecf4e11222eedb067a7db94..32bfbc9a4ca53361f68351c4ba1da75b6af1ff81 100644 (file)
@@ -695,25 +695,26 @@ _kiwi.view.Tabs = Backbone.View.extend({
 \r
         this.model.on('active', this.panelActive, this);\r
 \r
-        this.tabs_applets = $('ul.applets', this.$el);\r
-        this.tabs_msg = $('ul.channels', this.$el);\r
+        //this.tabs_applets = $('ul.applets', this.$el);\r
+        //this.tabs_msg = $('ul.channels', this.$el);\r
 \r
         this.model.network.on('change:name', function (network, new_val) {\r
             $('span', this.model.server.tab).text(new_val);\r
         }, this);\r
 \r
-        $('#kiwi .panellist.channels').append(this.$el);\r
+        this.$tab_container = $('#kiwi .panellist.channels');\r
+        this.$tab_container.append(this.$el);\r
     },\r
 \r
     render: function () {\r
         var that = this;\r
 \r
-        this.tabs_msg.empty();\r
+        this.$el.empty();\r
         \r
         // Add the server tab first\r
         this.model.server.tab\r
             .data('panel', this.model.server)\r
-            .appendTo(this.tabs_msg);\r
+            .appendTo(this.$el);\r
 \r
         // Go through each panel adding its tab\r
         this.model.forEach(function (panel) {\r
@@ -759,8 +760,7 @@ _kiwi.view.Tabs = Backbone.View.extend({
     panelActive: function (panel, previously_active_panel) {\r
         // Remove any existing tabs or part images\r
         $('.part', this.$el).remove();\r
-        this.tabs_applets.children().removeClass('active');\r
-        this.tabs_msg.children().removeClass('active');\r
+        this.$tab_container.find('.active').removeClass('active');\r
 \r
         panel.tab.addClass('active');\r
 \r
@@ -796,14 +796,14 @@ _kiwi.view.Tabs = Backbone.View.extend({
     },\r
 \r
     next: function () {\r
-        var next = _kiwi.app.panels.active.tab.next();\r
-        if (!next.length) next = $('li:first', this.tabs_msgs);\r
+        var next = this.$tab_container.find('.active').next();\r
+        if (!next.length) next = $('li:first', this.$tab_container);\r
 \r
         next.click();\r
     },\r
     prev: function () {\r
-        var prev = _kiwi.app.panels.active.tab.prev();\r
-        if (!prev.length) prev = $('li:last', this.tabs_msgs);\r
+        var prev = this.$tab_container.find('.active').prev();\r
+        if (!prev.length) prev = $('li:last', this.$tab_container);\r
 \r
         prev.click();\r
     }\r