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:
parent
7a86d60c6f
commit
8b2f5c7bb7
@ -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);
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user