From: Darren Date: Sun, 30 Mar 2014 12:03:20 +0000 (+0100) Subject: Focus control input on switching tabs X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9076c054b7146ba671c9243e4a24455091a8f768;p=KiwiIRC.git Focus control input on switching tabs --- 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) {