From 7f1479ffda0ec8a0cdeda2175a20e3b2dd098936 Mon Sep 17 00:00:00 2001 From: MoonLeeeaf <150461955+MoonLeeeaf@users.noreply.github.com> Date: Fri, 28 Jun 2024 21:42:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Tab=E8=8F=9C=E5=8D=95=E7=9A=84=E5=8F=B3?= =?UTF-8?q?=E9=94=AE=E8=8F=9C=E5=8D=95=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 如题 2. CachedString 重命名为 CachedData --- ling_chair_http/handler.js | 31 ++++++++++++++++++------------- ling_chair_http/utils.js | 18 +++++++++--------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/ling_chair_http/handler.js b/ling_chair_http/handler.js index f236f5f..31e4127 100644 --- a/ling_chair_http/handler.js +++ b/ling_chair_http/handler.js @@ -274,7 +274,7 @@ class ChatTabManager { */ static add(title, target) { if (this.tabs[target]) return - let tabElement = $($.parseHTML(`${title}`)) + let tabElement = $($.parseHTML(`${title}`)) tabElement.appendTo(viewBinding.chatTab) // 就你MDUI的B事最多 加Tab还多一个下划线 删掉就解决了 $(".mdui-tab-indicator").remove() @@ -309,17 +309,14 @@ class ChatTabManager { let menu let callback = (e) => { if (menu) menu.close() - // 切到 div.message-content + // 切到 chatTab let ele = e.get(0) let menuHtml = $.parseHTML(`
`) let $menu = $(menuHtml) @@ -364,6 +361,14 @@ class ChatPage { this.chatPageElement.appendTo(viewBinding.pageChatSeesion) ;(async () => await this.loadMore())() } + /** + * 获取某个聊天栏 + * @param { String } target + * @returns { jQuery } + */ + static getChatSeesion(target) { + return ChatPage.cached[target] + } /** * 获取当前的聊天栏 * @returns { jQuery } @@ -376,7 +381,7 @@ class ChatPage { * @returns { ChatPage } */ static getCurrentChatPage() { - return ChatPage.cached[$(".chat-seesion[actived=true]").attr("target")] + return this.getChatSeesion($(".chat-seesion[actived=true]").attr("target")) } /** * 切换选择的聊天对象 @@ -387,7 +392,7 @@ class ChatPage { this.minMsgId = null for (let k of Object.keys(ChatPage.cached)) { - let cpe = ChatPage.cached[k].chatPageElement + let cpe = ChatPage.getChatSeesion(k).chatPageElement cpe.attr("actived", null) cpe.hide() } @@ -644,10 +649,10 @@ class ChatMsgAdapter { let menuHtml = $.parseHTML(`