mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #7562
This commit is contained in:
@@ -425,6 +425,7 @@ app.cacheBuster = null;
|
|||||||
return user && parseInt(user.uid, 10) !== parseInt(app.user.uid, 10);
|
return user && parseInt(user.uid, 10) !== parseInt(app.user.uid, 10);
|
||||||
});
|
});
|
||||||
roomData.uid = uid || app.user.uid;
|
roomData.uid = uid || app.user.uid;
|
||||||
|
roomData.isSelf = true;
|
||||||
chat.createModal(roomData, loadAndCenter);
|
chat.createModal(roomData, loadAndCenter);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ define('chat', [
|
|||||||
title: '[[modules:chat.chatting_with]] ' + (data.roomName || username),
|
title: '[[modules:chat.chatting_with]] ' + (data.roomName || username),
|
||||||
touid: data.message.fromUser.uid,
|
touid: data.message.fromUser.uid,
|
||||||
roomId: data.roomId,
|
roomId: data.roomId,
|
||||||
|
isSelf: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -89,8 +90,8 @@ define('chat', [
|
|||||||
});
|
});
|
||||||
roomData.silent = true;
|
roomData.silent = true;
|
||||||
roomData.uid = app.user.uid;
|
roomData.uid = app.user.uid;
|
||||||
module.createModal(roomData, function (modal) {
|
roomData.isSelf = isSelf;
|
||||||
module.toggleNew(modal.attr('data-uuid'), !isSelf, true);
|
module.createModal(roomData, function () {
|
||||||
if (!isSelf) {
|
if (!isSelf) {
|
||||||
updateTitleAndPlaySound(data.message.mid, username);
|
updateTitleAndPlaySound(data.message.mid, username);
|
||||||
}
|
}
|
||||||
@@ -231,13 +232,15 @@ define('chat', [
|
|||||||
roomId: data.roomId,
|
roomId: data.roomId,
|
||||||
icon: 'fa-comment',
|
icon: 'fa-comment',
|
||||||
state: '',
|
state: '',
|
||||||
|
isSelf: data.isSelf,
|
||||||
|
}, function () {
|
||||||
|
taskbar.toggleNew(chatModal.attr('data-uuid'), !data.isSelf);
|
||||||
|
$(window).trigger('action:chat.loaded', chatModal);
|
||||||
|
|
||||||
|
if (typeof callback === 'function') {
|
||||||
|
callback(chatModal);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).trigger('action:chat.loaded', chatModal);
|
|
||||||
|
|
||||||
if (typeof callback === 'function') {
|
|
||||||
callback(chatModal);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -79,7 +79,8 @@ define('taskbar', ['benchpress', 'translator'], function (Benchpress, translator
|
|||||||
update();
|
update();
|
||||||
};
|
};
|
||||||
|
|
||||||
taskbar.push = function (module, uuid, options) {
|
taskbar.push = function (module, uuid, options, callback) {
|
||||||
|
callback = callback || function () {};
|
||||||
var element = taskbar.tasklist.find('li[data-uuid="' + uuid + '"]');
|
var element = taskbar.tasklist.find('li[data-uuid="' + uuid + '"]');
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
@@ -92,7 +93,9 @@ define('taskbar', ['benchpress', 'translator'], function (Benchpress, translator
|
|||||||
$(window).trigger('filter:taskbar.push', data);
|
$(window).trigger('filter:taskbar.push', data);
|
||||||
|
|
||||||
if (!element.length && data.module) {
|
if (!element.length && data.module) {
|
||||||
createTaskbar(data);
|
createTaskbarItem(data, callback);
|
||||||
|
} else {
|
||||||
|
callback(element);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -146,7 +149,7 @@ define('taskbar', ['benchpress', 'translator'], function (Benchpress, translator
|
|||||||
taskbar.tasklist.find('.active').removeClass('active');
|
taskbar.tasklist.find('.active').removeClass('active');
|
||||||
}
|
}
|
||||||
|
|
||||||
function createTaskbar(data) {
|
function createTaskbarItem(data, callback) {
|
||||||
translator.translate(data.options.title, function (taskTitle) {
|
translator.translate(data.options.title, function (taskTitle) {
|
||||||
var title = $('<div></div>').text(taskTitle || 'NodeBB Task').html();
|
var title = $('<div></div>').text(taskTitle || 'NodeBB Task').html();
|
||||||
|
|
||||||
@@ -175,6 +178,7 @@ define('taskbar', ['benchpress', 'translator'], function (Benchpress, translator
|
|||||||
|
|
||||||
taskbarEl.data(data);
|
taskbarEl.data(data);
|
||||||
$(window).trigger('action:taskbar.pushed', data);
|
$(window).trigger('action:taskbar.pushed', data);
|
||||||
|
callback(taskbarEl);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user