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(`