Focus input on change

This commit is contained in:
Mattias Erming 2014-08-03 17:05:17 -07:00
parent 98465ce9e5
commit 3fb8096daa
2 changed files with 9 additions and 4 deletions

View File

@ -275,7 +275,7 @@ $(function() {
}); });
var top = 1; var top = 1;
sidebar.on("click", "button:not(.active)", function() { sidebar.on("click", "button", function() {
var self = $(this); var self = $(this);
var target = self.data("target"); var target = self.data("target");
if (!target) { if (!target) {
@ -306,11 +306,16 @@ $(function() {
$("#windows .active").removeClass("active"); $("#windows .active").removeClass("active");
var chan = $(target) var chan = $(target)
.css("z-index", top++)
.addClass("active") .addClass("active")
.trigger("show") .trigger("show")
.css("z-index", top++)
.find(".chat") .find(".chat")
.sticky(); .sticky()
.end();
if (chan.hasClass("chan")) {
input.focus();
}
}); });
sidebar.on("click", "#sign-out", function() { sidebar.on("click", "#sign-out", function() {

View File

@ -1,7 +1,7 @@
{ {
"name": "shout", "name": "shout",
"description": "A web IRC client", "description": "A web IRC client",
"version": "0.8.8", "version": "0.8.9",
"homepage": "http://github.com/erming/shout", "homepage": "http://github.com/erming/shout",
"author": { "author": {
"name": "Mattias Erming", "name": "Mattias Erming",