1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-21 21:30:08 +00:00

Fix address bar update when changing room

This commit is contained in:
Tim Düsterhus 2014-06-20 17:26:51 +02:00
parent a4c3da02ba
commit 4091a6e7e6

View File

@ -844,13 +844,16 @@ Fetch the roomlist from the server and update it in the GUI.
roomList.active = room if room.active
li = $ '<li></li>'
li.addClass('timsChatRoom').data('roomID', room.roomID)
li.addClass 'timsChatRoom'
li.addClass 'active' if room.active
$("""<a href="#{room.link}">#{WCF.String.escapeHTML(room.title)}</a> <span class="badge">#{WCF.String.formatNumeric room.userCount}</span>""").appendTo li
a = $("""<a href="#{room.link}">#{WCF.String.escapeHTML(room.title)}</a>""")
a.data 'roomID', room.roomID
a.appendTo li
$("""<span class="badge">#{WCF.String.formatNumeric room.userCount}</span>""").appendTo li
$('#timsChatRoomList ul').append li
if window.history?.replaceState?
$('.timsChatRoom').click (event) ->
$('.timsChatRoom a').click (event) ->
do event.preventDefault
target = $ @