From 96e13535e1a0896e9fddaaaff453b58aee48f3bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 3 Dec 2011 15:06:36 +0100 Subject: [PATCH] Mark new room as active ... and old one no longer as active --- file/js/TimWolla.WCF.Chat.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/file/js/TimWolla.WCF.Chat.js b/file/js/TimWolla.WCF.Chat.js index 4aa7177..7a8e9f6 100644 --- a/file/js/TimWolla.WCF.Chat.js +++ b/file/js/TimWolla.WCF.Chat.js @@ -27,12 +27,14 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {}; $('.chatRoom').click($.proxy(function (event) { if (typeof window.history.replaceState != 'undefined') { event.preventDefault(); - this.changeRoom($(event.target).attr('href')); + this.changeRoom($(event.target)); } }, this)); }, - changeRoom: function(url) { - window.history.replaceState({}, '', url); + changeRoom: function(target) { + window.history.replaceState({}, '', target.attr('href')); + $('.activeMenuItem .chatRoom').parent().removeClass('activeMenuItem'); + target.parent().addClass('activeMenuItem'); } }; })(jQuery, document); \ No newline at end of file