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

Mark new room as active

... and old one no longer as active
This commit is contained in:
Tim Düsterhus 2011-12-03 15:06:36 +01:00
parent 01c23cda90
commit 96e13535e1

View File

@ -27,12 +27,14 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {};
$('.chatRoom').click($.proxy(function (event) {
if (typeof window.history.replaceState != 'undefined') {
event.preventDefault();
this.changeRoom($(event.target).attr('href'));
this.changeRoom($(event.target));
}
}, this));
},
changeRoom: function(url) {
window.history.replaceState({}, '', url);
changeRoom: function(target) {
window.history.replaceState({}, '', target.attr('href'));
$('.activeMenuItem .chatRoom').parent().removeClass('activeMenuItem');
target.parent().addClass('activeMenuItem');
}
};
})(jQuery, document);