diff --git a/clefincode_chat/__init__.py b/clefincode_chat/__init__.py index cd1e1b4..15f9368 100644 --- a/clefincode_chat/__init__.py +++ b/clefincode_chat/__init__.py @@ -1 +1 @@ -__version__ = '1.3.901' \ No newline at end of file +__version__ = '1.3.902' \ No newline at end of file diff --git a/clefincode_chat/public/js/components/erpnext_chat_contact_list.js b/clefincode_chat/public/js/components/erpnext_chat_contact_list.js index 6fd69e1..c7a6290 100644 --- a/clefincode_chat/public/js/components/erpnext_chat_contact_list.js +++ b/clefincode_chat/public/js/components/erpnext_chat_contact_list.js @@ -986,16 +986,31 @@ if (FRAPPE_MAJOR_VERSION == 16) { const isWebView = $("body").hasClass("cc-chat-webview"); - if (isWebView && me.add_member == 1 && me.chat_info) { + if (me.add_member == 1 && me.chat_info) { me.chat_info.$chat_info.removeClass("add-members-open"); + me.chat_info.$chat_info.find(".add-members-overlay").hide(); me.chat_info.$chat_info.find(".list_members").empty(); me.chat_info.$chat_info.find(".filter-members").hide().val(""); me.chat_info.$chat_info.find(".close_members_lis").css("visibility", "hidden"); + + me.$wrapper.find(".chat-contact-list").remove(); me.chat_info.add_member_list = null; + + if (isWebView) { + + me.chat_space.$wrapper.find(".chat-info").remove(); + me.chat_space.$wrapper.find(".chat-space").show(); + me.chat_space.$wrapper.find(".chat-topic-space").show(); + } else { + + me.$wrapper.find(".chat-info").show(); + } + return; } me.$wrapper.find(".chat-contact-list").remove(); + erpnext_chat_app.chat_contact_list = null; erpnext_chat_app.chat_list = new ChatList({ $wrapper: me.$wrapper, @@ -1177,13 +1192,6 @@ render() { const $target = $overlay.find(".list_members"); this.chat_info.$chat_info.addClass("add-members-open"); - this.chat_info.$chat_info.css({ - position: "absolute", - inset: "0", - "z-index": 99999, - display: "flex", - "flex-direction": "column" - }); $overlay.css({ display: "flex", @@ -1199,23 +1207,18 @@ render() { $target.empty().append(this.$chat_contact_list); - this.$chat_contact_list.css({ - height: "100%", - display: "flex", - "flex-direction": "column" - }); + return; + } - this.$chat_contact_list.find(".chat-contacts-container").css({ - flex: "1 1 auto", - height: "auto", - "min-height": "0", - "overflow-y": "auto" - }); + if (!isWebView && this.add_member == 1 && this.chat_info) { + this.$wrapper.find(".chat-contact-list").remove(); + this.$wrapper.find(".chat-info").hide(); + this.$wrapper.find(".chat-space").hide(); + this.$wrapper.append(this.$chat_contact_list); return; } - if (FRAPPE_MAJOR_VERSION == 16) { this.ready.then(() => { let $view = this.$wrapper.find(".chat-view"); @@ -1228,7 +1231,7 @@ render() { $view.empty().append(this.$chat_contact_list); }); } else { - if (this.add_member == 1 || this.forward == 1 || this.topic_picker) { + if (this.forward == 1 || this.topic_picker) { this.$wrapper.find(".chat-info").hide(); this.$wrapper.find(".chat-space").hide(); this.$wrapper.append(this.$chat_contact_list); @@ -1237,7 +1240,6 @@ render() { } } } - async create_group() { show_overlay(""); diff --git a/clefincode_chat/public/js/components/erpnext_chat_info.js b/clefincode_chat/public/js/components/erpnext_chat_info.js index 50745f3..2d66ef2 100644 --- a/clefincode_chat/public/js/components/erpnext_chat_info.js +++ b/clefincode_chat/public/js/components/erpnext_chat_info.js @@ -1412,10 +1412,22 @@ save_all_contacts(dialog) { me.open_chat_space(channel, channel_name); }); - this.$chat_info.find(".add_members").on("click", function () { - me.$chat_info.addClass("add-members-open"); - me.$chat_info.find(".filter-members").show().val("").focus(); - me.$chat_info.find(".list_members").html(""); + this.$chat_info.find(".add_members").on("click", async function () { + const isWebView = $("body").hasClass("cc-chat-webview"); + + if (isWebView) { + me.$chat_info.addClass("add-members-open"); + me.$chat_info.find(".add-members-overlay").show(); + me.$chat_info.find(".filter-members").show().val("").focus(); + me.$chat_info.find(".list_members").html(""); + me.$chat_info.find(".close_members_lis").css("visibility", "visible"); + } else { + me.$chat_info.removeClass("add-members-open"); + me.$chat_info.find(".add-members-overlay").hide(); + me.$chat_info.find(".filter-members").hide().val(""); + me.$chat_info.find(".list_members").html(""); + me.$chat_info.find(".close_members_lis").css("visibility", "hidden"); + } me.add_member_list = new ChatContactList({ $wrapper: me.chat_space.$wrapper, @@ -1424,8 +1436,12 @@ save_all_contacts(dialog) { add_member: 1, }); + if (me.add_member_list.ready) { + await me.add_member_list.ready; + } + me.add_member_list.render(); - }); +}); this.$chat_info.find(".close_members_lis").on("click", function () { const list_of_members = me.$chat_info.find(".list_members"); diff --git a/setup.py b/setup.py index ddf059a..7089e31 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name="clefincode_chat", - version='1.3.901', + version='1.3.902', description="ERPNext & Frappe Business Chat: A self-hosted communication solution.", author="ClefinCode L.L.C-FZ", author_email="info@clefincode.com",