From a19eea4ad7819b047a290f1f8ae4b3a50606c196 Mon Sep 17 00:00:00 2001 From: Phillip Date: Mon, 30 Jan 2023 00:27:02 +0200 Subject: [PATCH] add loader to goToReply --- .../plugins/core/components/ChatPage.js | 64 +++++++++++++++---- .../plugins/core/components/ChatScroller.js | 2 +- 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/qortal-ui-plugins/plugins/core/components/ChatPage.js b/qortal-ui-plugins/plugins/core/components/ChatPage.js index eb1f7926..861cb419 100644 --- a/qortal-ui-plugins/plugins/core/components/ChatPage.js +++ b/qortal-ui-plugins/plugins/core/components/ChatPage.js @@ -103,7 +103,8 @@ class ChatPage extends LitElement { openUserInfo: { type: Boolean }, selectedHead: { type: Object }, userName: { type: String }, - goToRepliedMessage: {attribute: false} + goToRepliedMessage: {attribute: false}, + isLoadingGoToRepliedMessage: {type: Object} } } @@ -890,6 +891,12 @@ class ChatPage extends LitElement { this.currentEditor = '_chatEditorDOM' this.initialChat = this.initialChat.bind(this) this.isEnabledChatEnter = true + this.isLoadingGoToRepliedMessage = { + isLoading: false, + top: 0, + left: 0, + offsetHeight: 0 + } } _toggle(value) { @@ -957,6 +964,9 @@ class ChatPage extends LitElement { ` : this.renderChatScroller()} + ${this.isLoadingGoToRepliedMessage && this.isLoadingGoToRepliedMessage.loading ? html` +
+ ` : ''}
this.setSelectedHead(val)} ?openTipUser=${this.openTipUser} .selectedHead=${this.selectedHead} - .goToRepliedMessage=${(val)=> this.goToRepliedMessage(val)} + .goToRepliedMessage=${(val, val2)=> this.goToRepliedMessage(val, val2)} .getOldMessageAfter=${(val)=> this.getOldMessageAfter(val)} > diff --git a/qortal-ui-plugins/plugins/core/components/ChatScroller.js b/qortal-ui-plugins/plugins/core/components/ChatScroller.js index b94fd3f4..e9a9c895 100644 --- a/qortal-ui-plugins/plugins/core/components/ChatScroller.js +++ b/qortal-ui-plugins/plugins/core/components/ChatScroller.js @@ -554,7 +554,7 @@ class MessageTemplate extends LitElement { ${repliedToData && html`
{ - this.goToRepliedMessage(repliedToData) + this.goToRepliedMessage(repliedToData, this.messageObj) }}>