mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Prevent new loading of active channel.
This commit is contained in:
parent
19d621a31f
commit
c0f481fb13
@ -35,10 +35,6 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {};
|
|||||||
changeRoom: function(target) {
|
changeRoom: function(target) {
|
||||||
window.history.replaceState({}, '', target.attr('href'));
|
window.history.replaceState({}, '', target.attr('href'));
|
||||||
|
|
||||||
// mark as active;
|
|
||||||
$('.activeMenuItem .chatRoom').parent().removeClass('activeMenuItem');
|
|
||||||
target.parent().addClass('activeMenuItem');
|
|
||||||
|
|
||||||
// actually change the room
|
// actually change the room
|
||||||
$.ajax(target.attr('href'), {
|
$.ajax(target.attr('href'), {
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
@ -73,7 +69,12 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {};
|
|||||||
$('title').text(this.titleTemplate.fetch(data));
|
$('title').text(this.titleTemplate.fetch(data));
|
||||||
}, this),
|
}, this),
|
||||||
beforeSend: $.proxy(function () {
|
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;
|
this.loading = true;
|
||||||
//target.append('<img id="loading-' + target.attr('id') + '" src="' + WCF.Icon.get('wcf.global.spinner') + '" />');
|
//target.append('<img id="loading-' + target.attr('id') + '" src="' + WCF.Icon.get('wcf.global.spinner') + '" />');
|
||||||
target.css({
|
target.css({
|
||||||
|
Loading…
Reference in New Issue
Block a user