迁移聊天室菜单显示逻辑
This commit is contained in:
@@ -311,8 +311,12 @@
|
||||
* 关闭功能菜单。
|
||||
*/
|
||||
function closeFeatureMenu() {
|
||||
const menu = document.getElementById('feature-menu');
|
||||
if (window.ChatRoomTools?.closeFeatureMenu) {
|
||||
window.ChatRoomTools.closeFeatureMenu();
|
||||
return;
|
||||
}
|
||||
|
||||
const menu = document.getElementById('feature-menu');
|
||||
if (menu) {
|
||||
menu.style.display = 'none';
|
||||
}
|
||||
@@ -324,33 +328,24 @@
|
||||
* @param {Event} event 点击事件
|
||||
*/
|
||||
function toggleFeatureMenu(event) {
|
||||
event.stopPropagation();
|
||||
if (window.ChatRoomTools?.toggleFeatureMenu) {
|
||||
window.ChatRoomTools.toggleFeatureMenu(event, syncDailyStatusUi);
|
||||
return;
|
||||
}
|
||||
|
||||
event?.stopPropagation?.();
|
||||
const menu = document.getElementById('feature-menu');
|
||||
const welcomeMenu = document.getElementById('welcome-menu');
|
||||
const adminMenu = document.getElementById('admin-menu');
|
||||
const blockMenu = document.getElementById('block-menu');
|
||||
const editorOverlay = document.getElementById('daily-status-editor-overlay');
|
||||
|
||||
if (!menu) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (welcomeMenu) {
|
||||
welcomeMenu.style.display = 'none';
|
||||
}
|
||||
|
||||
if (adminMenu) {
|
||||
adminMenu.style.display = 'none';
|
||||
}
|
||||
|
||||
if (blockMenu) {
|
||||
blockMenu.style.display = 'none';
|
||||
}
|
||||
|
||||
if (editorOverlay) {
|
||||
editorOverlay.style.display = 'none';
|
||||
}
|
||||
['welcome-menu', 'admin-menu', 'block-menu', 'daily-status-editor-overlay'].forEach((id) => {
|
||||
const panel = document.getElementById(id);
|
||||
if (panel) {
|
||||
panel.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
syncDailyStatusUi();
|
||||
menu.style.display = menu.style.display === 'none' ? 'block' : 'none';
|
||||
@@ -360,11 +355,15 @@
|
||||
* 打开状态编辑窗口。
|
||||
*/
|
||||
function openDailyStatusEditor() {
|
||||
const overlay = document.getElementById('daily-status-editor-overlay');
|
||||
if (window.ChatRoomTools?.openDailyStatusEditor) {
|
||||
window.ChatRoomTools.openDailyStatusEditor(syncDailyStatusUi);
|
||||
return;
|
||||
}
|
||||
|
||||
closeFeatureMenu();
|
||||
syncDailyStatusUi();
|
||||
|
||||
const overlay = document.getElementById('daily-status-editor-overlay');
|
||||
if (overlay) {
|
||||
overlay.style.display = 'block';
|
||||
}
|
||||
@@ -374,8 +373,12 @@
|
||||
* 关闭状态编辑窗口。
|
||||
*/
|
||||
function closeDailyStatusEditor() {
|
||||
const overlay = document.getElementById('daily-status-editor-overlay');
|
||||
if (window.ChatRoomTools?.closeDailyStatusEditor) {
|
||||
window.ChatRoomTools.closeDailyStatusEditor();
|
||||
return;
|
||||
}
|
||||
|
||||
const overlay = document.getElementById('daily-status-editor-overlay');
|
||||
if (overlay) {
|
||||
overlay.style.display = 'none';
|
||||
}
|
||||
@@ -1247,32 +1250,24 @@
|
||||
* @param {Event} event 点击事件
|
||||
*/
|
||||
function toggleBlockMenu(event) {
|
||||
event.stopPropagation();
|
||||
if (window.ChatRoomTools?.toggleBlockMenu) {
|
||||
window.ChatRoomTools.toggleBlockMenu(event, syncBlockedSystemSenderCheckboxes);
|
||||
return;
|
||||
}
|
||||
|
||||
event?.stopPropagation?.();
|
||||
const menu = document.getElementById('block-menu');
|
||||
const welcomeMenu = document.getElementById('welcome-menu');
|
||||
const adminMenu = document.getElementById('admin-menu');
|
||||
const featureMenu = document.getElementById('feature-menu');
|
||||
const dailyStatusEditor = document.getElementById('daily-status-editor-overlay');
|
||||
|
||||
if (!menu) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (welcomeMenu) {
|
||||
welcomeMenu.style.display = 'none';
|
||||
}
|
||||
|
||||
if (adminMenu) {
|
||||
adminMenu.style.display = 'none';
|
||||
}
|
||||
|
||||
if (featureMenu) {
|
||||
featureMenu.style.display = 'none';
|
||||
}
|
||||
|
||||
if (dailyStatusEditor) {
|
||||
dailyStatusEditor.style.display = 'none';
|
||||
}
|
||||
['welcome-menu', 'admin-menu', 'feature-menu', 'daily-status-editor-overlay'].forEach((id) => {
|
||||
const panel = document.getElementById(id);
|
||||
if (panel) {
|
||||
panel.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
syncBlockedSystemSenderCheckboxes();
|
||||
menu.style.display = menu.style.display === 'none' ? 'block' : 'none';
|
||||
|
||||
Reference in New Issue
Block a user