diff --git a/resources/js/chat-room/profile-controls.js b/resources/js/chat-room/profile-controls.js index e6c8aae..12ae83d 100644 --- a/resources/js/chat-room/profile-controls.js +++ b/resources/js/chat-room/profile-controls.js @@ -10,6 +10,7 @@ let profileControlEventsBound = false; * @returns {void} */ function callGlobal(functionName, ...args) { + // 头像与设置的大段业务仍在 Blade 内,模块阶段先集中桥接旧全局函数。 if (typeof window[functionName] === "function") { window[functionName](...args); } @@ -31,6 +32,7 @@ export function bindProfileControls() { return; } + // 头像选择器包含静态按钮和动态头像项,统一用 data-* 事件代理承接。 if (event.target.closest("[data-avatar-picker-close]")) { event.preventDefault(); callGlobal("closeAvatarPicker"); @@ -56,6 +58,7 @@ export function bindProfileControls() { return; } + // 设置弹窗的保存、验证码、微信绑定仍走原请求函数,避免迁移中改变接口行为。 if (event.target.closest("[data-settings-save-password]")) { event.preventDefault(); callGlobal("savePassword"); diff --git a/resources/js/chat-room/right-panel.js b/resources/js/chat-room/right-panel.js index 1806a74..3b903d7 100644 --- a/resources/js/chat-room/right-panel.js +++ b/resources/js/chat-room/right-panel.js @@ -18,6 +18,7 @@ export function bindChatRightPanelControls() { return; } + // 右侧名单和房间 tab 仍由 Blade 主脚本维护状态,这里只转发点击入口。 const tabButton = event.target.closest("[data-chat-right-tab]"); if (tabButton) { event.preventDefault(); @@ -25,6 +26,7 @@ export function bindChatRightPanelControls() { return; } + // 在线名单刷新函数仍在主聊天脚本中,后续渲染整体迁移后再收口到模块内。 const refreshButton = event.target.closest("[data-chat-user-list-refresh]"); if (refreshButton) { event.preventDefault(); @@ -45,6 +47,7 @@ export function bindChatRightPanelControls() { return; } + // 搜索输入高频触发,继续复用主脚本里的 RAF 节流渲染。 window.scheduleFilterUserList?.(); }); } diff --git a/resources/js/chat-room/vip-controls.js b/resources/js/chat-room/vip-controls.js index cfc104f..1d4acd5 100644 --- a/resources/js/chat-room/vip-controls.js +++ b/resources/js/chat-room/vip-controls.js @@ -10,6 +10,7 @@ let vipControlEventsBound = false; * @returns {void} */ function callVipGlobal(functionName, ...args) { + // VIP 业务函数暂留在 Blade 内,当前模块只统一按钮事件与旧函数调用边界。 if (typeof window[functionName] === "function") { window[functionName](...args); } @@ -31,6 +32,7 @@ export function bindVipControls() { return; } + // VIP 内容由接口动态渲染,tab 和购买按钮通过 data-* 代理避免重复绑定。 const tabButton = event.target.closest("[data-vip-tab]"); if (tabButton) { event.preventDefault();