fix: 修复迁移遗留的按钮无响应、头像框层级及构建错误
迁移收尾修复:
- heartbeat.js: 移除 export { } 中重复的 startHeartbeat/stopHeartbeat(已通过 export function 导出)
- scripts.blade.php: 移除 JS 注释中的 {{ }} 避免 Blade 编译为 e() 导致 PHP 解析错误
- preferences-status.js: 补全 6 个缺失的 window.* 赋值(toggleBlockMenu/toggleFeatureMenu 等),
实现迁移中丢失的 updateDailyStatus/clearDailyStatus,修复 handleFeatureLocalClear 清屏回调
- toolbar.js: 补全 window.runFeatureShortcut 赋值
头像框样式修复(chat-decorations.css):
- z-index 互换:头像降至 1,框升至 3,使框边缘可遮挡头像外围
- 使用 CSS mask(radial-gradient)挖环形替代旧 ::before 实心圆遮挡方案
- clip-path: circle(50%) 硬裁剪确保圆形,不受 chat.css border-radius: 2px 覆盖
- 特异性提升至 .user-item .avatar-frame-wrapper .user-head
新 Vite 模块(从 Blade 迁移):
- chat-state.js / message-renderer.js / user-list.js / chat-events.js
- composer.js(重写)/ heartbeat.js / admin-commands.js
- vip-presence.js / chat-decorations.css
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
// 聊天室管理菜单事件绑定,替代 input-bar 中的管理类内联 onclick。
|
||||
// 管理动作业务逻辑已迁至 admin-commands.js。
|
||||
|
||||
import "./admin-commands.js";
|
||||
|
||||
let adminMenuEventsBound = false;
|
||||
|
||||
/**
|
||||
* 绑定管理菜单、管理动作与全屏特效选择事件。
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
export function bindAdminMenuControls() {
|
||||
if (adminMenuEventsBound || typeof document === "undefined") {
|
||||
@@ -22,33 +23,26 @@ export function bindAdminMenuControls() {
|
||||
if (menuToggle) {
|
||||
event.preventDefault();
|
||||
window.toggleAdminMenu?.(event);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const adminAction = event.target.closest("[data-chat-admin-action]");
|
||||
if (adminAction) {
|
||||
event.preventDefault();
|
||||
|
||||
// 管理菜单只负责入口分发,权限校验和实际动作仍由后端与原有全局函数负责。
|
||||
const action = adminAction.getAttribute("data-chat-admin-action") || "";
|
||||
if (action && typeof window.runAdminAction === "function") {
|
||||
window.runAdminAction(action);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const effectButton = event.target.closest("[data-chat-admin-effect]");
|
||||
if (effectButton) {
|
||||
event.preventDefault();
|
||||
|
||||
// 特效按钮只触发管理员发起请求,实际播放仍由 chat:effect 广播和 EffectManager 处理。
|
||||
const effect = effectButton.getAttribute("data-chat-admin-effect") || "";
|
||||
if (effect && typeof window.selectEffect === "function") {
|
||||
window.selectEffect(effect);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user