迁移功能菜单和每日状态事件绑定
This commit is contained in:
@@ -198,6 +198,97 @@ export function bindBlockMenuControls() {
|
||||
return;
|
||||
}
|
||||
|
||||
const featureMenuTrigger = event.target.closest("[data-chat-feature-menu-toggle]");
|
||||
if (featureMenuTrigger) {
|
||||
event.preventDefault();
|
||||
window.toggleFeatureMenu?.(event);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const dailyStatusCloseButton = event.target.closest("[data-chat-daily-status-close]");
|
||||
if (dailyStatusCloseButton) {
|
||||
event.preventDefault();
|
||||
window.closeDailyStatusEditor?.();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const dailyStatusClearButton = event.target.closest("[data-chat-daily-status-clear]");
|
||||
if (dailyStatusClearButton) {
|
||||
event.preventDefault();
|
||||
window.clearDailyStatus?.();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const dailyStatusItem = event.target.closest("[data-chat-daily-status-select]");
|
||||
if (dailyStatusItem) {
|
||||
event.preventDefault();
|
||||
|
||||
const statusKey = dailyStatusItem.getAttribute("data-chat-daily-status-select") || "";
|
||||
if (statusKey && typeof window.updateDailyStatus === "function") {
|
||||
window.updateDailyStatus(statusKey);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.target.closest("[data-chat-daily-status-editor]")) {
|
||||
event.stopPropagation();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.target.closest("[data-chat-daily-status-overlay]")) {
|
||||
window.closeDailyStatusEditor?.();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const localClearButton = event.target.closest("[data-chat-feature-local-clear]");
|
||||
if (localClearButton) {
|
||||
event.preventDefault();
|
||||
window.handleFeatureLocalClear?.();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const dailyStatusOpenButton = event.target.closest("[data-chat-daily-status-open]");
|
||||
if (dailyStatusOpenButton) {
|
||||
event.preventDefault();
|
||||
window.openDailyStatusEditor?.();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const dailySignInButton = event.target.closest("[data-chat-feature-sign-in]");
|
||||
if (dailySignInButton) {
|
||||
event.preventDefault();
|
||||
window.closeFeatureMenu?.();
|
||||
window.quickDailySignIn?.();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const shortcutButton = event.target.closest("[data-chat-feature-shortcut]");
|
||||
if (shortcutButton) {
|
||||
event.preventDefault();
|
||||
|
||||
const action = shortcutButton.getAttribute("data-chat-feature-shortcut") || "";
|
||||
if (action && typeof window.runFeatureShortcut === "function") {
|
||||
window.runFeatureShortcut(action);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.target.closest("[data-chat-feature-menu]")) {
|
||||
event.stopPropagation();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const trigger = event.target.closest("[data-chat-block-menu-toggle]");
|
||||
if (trigger) {
|
||||
event.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user