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

Adding click-event for chat-rooms

This commit is contained in:
Tim Düsterhus 2011-12-03 15:01:54 +01:00
parent 7a86d60c6f
commit 8b2f5c7bb7
2 changed files with 11 additions and 1 deletions

View File

@ -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);

View File

@ -173,7 +173,7 @@
<ul>
{foreach from=$rooms item='roomListRoom'}
<li{if $roomListRoom->roomID == $room->roomID} class="activeMenuItem"{/if}>
<a href="{link controller='Chat' object=$roomListRoom}{/link}">{$roomListRoom->title|language}</a>
<a href="{link controller='Chat' object=$roomListRoom}{/link}" class="chatRoom">{$roomListRoom->title|language}</a>
</li>
{/foreach}
</ul>