修复:双击用户名打开名片弹窗
- 用户列表项双击触发 Alpine.js fetchUser 方法 - 打开用户名片弹窗,可查看资料和执行管理操作 - 单击仍为选中聊天目标
This commit is contained in:
@@ -162,9 +162,18 @@
|
|||||||
toUserSelect.value = username;
|
toUserSelect.value = username;
|
||||||
document.getElementById('content').focus();
|
document.getElementById('content').focus();
|
||||||
};
|
};
|
||||||
|
// 双击打开用户名片弹窗
|
||||||
item.ondblclick = () => {
|
item.ondblclick = () => {
|
||||||
if (username !== window.chatContext.username) {
|
if (username !== window.chatContext.username) {
|
||||||
showUserInfoInSay2(username);
|
// 触发 Alpine.js 用户名片弹窗
|
||||||
|
const modalContainer = document.getElementById('user-modal-container');
|
||||||
|
if (modalContainer && modalContainer.__x) {
|
||||||
|
modalContainer.__x.$data.fetchUser(username);
|
||||||
|
} else if (modalContainer) {
|
||||||
|
// Alpine v3 使用 _x_dataStack
|
||||||
|
const alpineData = Alpine.$data(modalContainer);
|
||||||
|
if (alpineData) alpineData.fetchUser(username);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
userList.appendChild(item);
|
userList.appendChild(item);
|
||||||
|
|||||||
Reference in New Issue
Block a user