Tracking the active panel correctly
authorDarren <darren@darrenwhitlen.com>
Sun, 2 Mar 2014 13:09:25 +0000 (13:09 +0000)
committerDarren <darren@darrenwhitlen.com>
Sun, 2 Mar 2014 13:09:25 +0000 (13:09 +0000)
client/src/models/application.js

index 3a09516bb8a0d4945701f5a72f0225d323512d0e..d8d6ba64d6132a346bb11195aa2c89bb1884bd4b 100644 (file)
 \r
 \r
         panels: (function() {\r
+            var active_panel;\r
+\r
             var fn = function(panel_type) {\r
                 var panels;\r
 \r
                 }\r
 \r
                 // Active panels / server\r
-                panels.active = this.connections.active_panel;\r
+                panels.active = active_panel;\r
                 panels.server = this.connections.active_connection ?\r
                     this.connections.active_connection.panels.server :\r
                     null;\r
 \r
             _.extend(fn, Backbone.Events);\r
 \r
+            // Keep track of the active panel. Channel/query/server or applet\r
+            fn.bind('active', function (new_active_panel) {\r
+                active_panel = new_active_panel;\r
+            });\r
+\r
             return fn;\r
         })(),\r
 \r