From aa24a133d163076260e5338a1674bbbd52afd71b Mon Sep 17 00:00:00 2001 From: Darren Date: Sun, 2 Mar 2014 13:09:25 +0000 Subject: [PATCH] Tracking the active panel correctly --- client/src/models/application.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/src/models/application.js b/client/src/models/application.js index 3a09516..d8d6ba6 100644 --- a/client/src/models/application.js +++ b/client/src/models/application.js @@ -309,6 +309,8 @@ panels: (function() { + var active_panel; + var fn = function(panel_type) { var panels; @@ -325,7 +327,7 @@ } // Active panels / server - panels.active = this.connections.active_panel; + panels.active = active_panel; panels.server = this.connections.active_connection ? this.connections.active_connection.panels.server : null; @@ -335,6 +337,11 @@ _.extend(fn, Backbone.Events); + // Keep track of the active panel. Channel/query/server or applet + fn.bind('active', function (new_active_panel) { + active_panel = new_active_panel; + }); + return fn; })(), -- 2.25.1