DEV: do not process composer preview when collapsed (#13941)

This commit is contained in:
Joffrey JAFFEUX 2021-08-04 16:40:31 +02:00 committed by GitHub
parent 11668ee85b
commit 5b85b254db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 2 deletions

View File

@ -74,6 +74,7 @@ export default Component.extend(ComposerUpload, {
shouldBuildScrollMap: true,
scrollMap: null,
processPreview: true,
uploadMarkdownResolvers,
uploadProcessorActions,

View File

@ -252,6 +252,7 @@ export default Component.extend({
emojiPickerIsActive: false,
emojiStore: service("emoji-store"),
isEditorFocused: false,
processPreview: true,
@discourseComputed("placeholder")
placeholderTranslated(placeholder) {
@ -387,7 +388,7 @@ export default Component.extend({
},
_updatePreview() {
if (this._state !== "inDOM") {
if (this._state !== "inDOM" || !this.processPreview) {
return;
}
@ -453,7 +454,7 @@ export default Component.extend({
});
},
@observes("ready", "value")
@observes("ready", "value", "processPreview")
_watchForChanges() {
if (!this.ready) {
return;

View File

@ -8,6 +8,7 @@
importQuote=(action "importQuote")
showUploadModal=showUploadModal
togglePreview=(action "togglePreview")
processPreview=processPreview
validation=validation
loading=composer.loading
forcePreview=forcePreview

View File

@ -127,6 +127,7 @@
cannotSeeMention=(action "cannotSeeMention")
importQuote=(action "importQuote")
togglePreview=(action "togglePreview")
processPreview=showPreview
showToolbar=showToolbar
afterRefresh=(action "afterRefresh")
focusTarget=focusTarget}}