From 3fb8096daa21d1e57dcaa47a9278cf482157ed73 Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Sun, 3 Aug 2014 17:05:17 -0700 Subject: [PATCH] Focus input on change --- client/js/chat.js | 11 ++++++++--- package.json | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/client/js/chat.js b/client/js/chat.js index e379f784..f3b521d1 100644 --- a/client/js/chat.js +++ b/client/js/chat.js @@ -275,7 +275,7 @@ $(function() { }); var top = 1; - sidebar.on("click", "button:not(.active)", function() { + sidebar.on("click", "button", function() { var self = $(this); var target = self.data("target"); if (!target) { @@ -306,11 +306,16 @@ $(function() { $("#windows .active").removeClass("active"); var chan = $(target) - .css("z-index", top++) .addClass("active") .trigger("show") + .css("z-index", top++) .find(".chat") - .sticky(); + .sticky() + .end(); + + if (chan.hasClass("chan")) { + input.focus(); + } }); sidebar.on("click", "#sign-out", function() { diff --git a/package.json b/package.json index edf00e25..efd90f65 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "shout", "description": "A web IRC client", - "version": "0.8.8", + "version": "0.8.9", "homepage": "http://github.com/erming/shout", "author": { "name": "Mattias Erming",