From c341d7a0b64002eb84949e014f95a6de7d908dac Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Fri, 25 Jul 2014 04:25:10 -0700 Subject: [PATCH] Remember active window between logins --- client/js/chat.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/js/chat.js b/client/js/chat.js index c45fb75f..5ed1ee5d 100644 --- a/client/js/chat.js +++ b/client/js/chat.js @@ -90,13 +90,11 @@ $(function() { }) ); - sidebar.find(".chan").eq(0).trigger("click"); sidebar.find(".empty").hide(); - $("body").removeClass("signed-out"); var id = $.cookie("target"); - var target = sidebar.find("[data-target=" + id + "]").trigger("click"); + var target = sidebar.find("[data-target='" + id + "']").trigger("click"); if (target.length === 0) { var first = sidebar.find(".chan") .eq(0) @@ -276,7 +274,9 @@ $(function() { return; } - $.cookie("target", target); + if (self.hasClass("chan")) { + $.cookie("target", target); + } chat.data( "id", self.data("id")