From 4091a6e7e6125539c863edb894032df2fd2c2e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 20 Jun 2014 17:26:51 +0200 Subject: [PATCH] Fix address bar update when changing room --- file/js/be.bastelstu.Chat.litcoffee | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/file/js/be.bastelstu.Chat.litcoffee b/file/js/be.bastelstu.Chat.litcoffee index b7a5c16..ed2beb4 100644 --- a/file/js/be.bastelstu.Chat.litcoffee +++ b/file/js/be.bastelstu.Chat.litcoffee @@ -844,13 +844,16 @@ Fetch the roomlist from the server and update it in the GUI. roomList.active = room if room.active li = $ '
  • ' - li.addClass('timsChatRoom').data('roomID', room.roomID) + li.addClass 'timsChatRoom' li.addClass 'active' if room.active - $("""#{WCF.String.escapeHTML(room.title)} #{WCF.String.formatNumeric room.userCount}""").appendTo li + a = $("""#{WCF.String.escapeHTML(room.title)}""") + a.data 'roomID', room.roomID + a.appendTo li + $("""#{WCF.String.formatNumeric room.userCount}""").appendTo li $('#timsChatRoomList ul').append li if window.history?.replaceState? - $('.timsChatRoom').click (event) -> + $('.timsChatRoom a').click (event) -> do event.preventDefault target = $ @