1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-10-31 14:10:08 +00:00

Prevent new loading of active channel.

This commit is contained in:
max-m 2011-12-04 01:27:21 +01:00
parent 19d621a31f
commit c0f481fb13

View File

@ -35,10 +35,6 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {};
changeRoom: function(target) {
window.history.replaceState({}, '', target.attr('href'));
// mark as active;
$('.activeMenuItem .chatRoom').parent().removeClass('activeMenuItem');
target.parent().addClass('activeMenuItem');
// actually change the room
$.ajax(target.attr('href'), {
dataType: 'json',
@ -73,7 +69,12 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {};
$('title').text(this.titleTemplate.fetch(data));
}, this),
beforeSend: $.proxy(function () {
if(this.loading == true) return;
if(this.loading == true || target.parent().attr('class') == "activeMenuItem") return false;
// mark as active;
$('.activeMenuItem .chatRoom').parent().removeClass('activeMenuItem');
target.parent().addClass('activeMenuItem');
this.loading = true;
//target.append('<img id="loading-' + target.attr('id') + '" src="' + WCF.Icon.get('wcf.global.spinner') + '" />');
target.css({