From 8b2f5c7bb76de3d7324bbfd19d26a410e0a03eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 3 Dec 2011 15:01:54 +0100 Subject: [PATCH] Adding click-event for chat-rooms --- file/js/TimWolla.WCF.Chat.js | 10 ++++++++++ template/chat.tpl | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/file/js/TimWolla.WCF.Chat.js b/file/js/TimWolla.WCF.Chat.js index b509c00..4aa7177 100644 --- a/file/js/TimWolla.WCF.Chat.js +++ b/file/js/TimWolla.WCF.Chat.js @@ -23,6 +23,16 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {}; $(window).bind('beforeunload', function() { return false; }); + + $('.chatRoom').click($.proxy(function (event) { + if (typeof window.history.replaceState != 'undefined') { + event.preventDefault(); + this.changeRoom($(event.target).attr('href')); + } + }, this)); + }, + changeRoom: function(url) { + window.history.replaceState({}, '', url); } }; })(jQuery, document); \ No newline at end of file diff --git a/template/chat.tpl b/template/chat.tpl index a041971..0565049 100644 --- a/template/chat.tpl +++ b/template/chat.tpl @@ -173,7 +173,7 @@