From 9076c054b7146ba671c9243e4a24455091a8f768 Mon Sep 17 00:00:00 2001 From: Darren Date: Sun, 30 Mar 2014 13:03:20 +0100 Subject: [PATCH] Focus control input on switching tabs --- client/src/views/controlbox.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/src/views/controlbox.js b/client/src/views/controlbox.js index 8fb5cb2..dbe30ac 100644 --- a/client/src/views/controlbox.js +++ b/client/src/views/controlbox.js @@ -29,6 +29,13 @@ _kiwi.view.ControlBox = Backbone.View.extend({ _kiwi.app.connections.on('active', function(panel, connection) { $('.nick', that.$el).text(connection.get('nick')); }); + + // Keep focus on the input box as we flick between panels + _kiwi.app.panels.bind('active', function (active_panel) { + if (active_panel.isChannel() || active_panel.isServer() || active_panel.isQuery()) { + that.$('.inp').focus(); + } + }); }, showNickChange: function (ev) { -- 2.25.1