From: Darren Date: Sun, 2 Mar 2014 13:09:25 +0000 (+0000) Subject: Tracking the active panel correctly X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=aa24a133d163076260e5338a1674bbbd52afd71b;p=KiwiIRC.git Tracking the active panel correctly --- 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; })(),