fix email collapse save

This commit is contained in:
Yurii
2026-02-02 17:42:38 +02:00
parent fd12203e1c
commit 5bf7774679
3 changed files with 38 additions and 17 deletions

View File

@@ -116,6 +116,10 @@ class ComposeEmailModalView extends EditModalView {
this.events['click a[data-action="fullFormDraft"]'] = () => this.actionFullFormDraft();
this.once('remove', () => {
this.dialogIsHidden = false;
});
const helper = new MailtoHelper(this.getConfig(), this.getPreferences(), this.getAcl());
if (helper.toUse()) {
@@ -125,14 +129,10 @@ class ComposeEmailModalView extends EditModalView {
const attributes = this.options.attributes || {};
this.once('after:render', () => document.location.href = helper.composeLink(attributes));
return;
}
}
this.once('remove', () => {
this.dialogIsHidden = false;
});
async setupLate() {
this.listenTo(this.model, 'change', (m, o) => {
if (o.ui) {
this.wasModified = true;

View File

@@ -198,7 +198,7 @@ class DetailModalView extends ModalView {
this.sourceModel = this.model;
this.getModelFactory().create(this.entityType).then(model => {
this.getModelFactory().create(this.entityType).then(async model => {
if (!this.sourceModel) {
this.model = model;
this.model.id = this.id;
@@ -216,7 +216,9 @@ class DetailModalView extends ModalView {
this.createRecordView();
});
this.model.fetch();
await this.setupLate();
await this.model.fetch();
return;
}
@@ -257,6 +259,14 @@ class DetailModalView extends ModalView {
}
}
/**
* Additional setup with the modal ready.
*
* @protected
* @since 9.3.0
*/
async setupLate() {}
/** @private */
setupActionItems() {
const actionItemSetup = new ActionItemSetup();

View File

@@ -226,22 +226,23 @@ class EditModalView extends ModalView {
model.id = this.id;
}
model.fetch()
.then(() => {
if (!this.headerText) {
this.headerHtml = this.composeHeaderHtml();
}
await this.setupLate();
this.createRecordView(model);
});
await model.fetch();
if (!this.headerText) {
this.headerHtml = this.composeHeaderHtml();
}
this.createRecordView(model);
return;
}
await new DefaultsPopulator().populate(model);
this.model = model;
await new DefaultsPopulator().populate(model);
if (this.options.relate) {
model.setRelate(this.options.relate);
}
@@ -250,6 +251,8 @@ class EditModalView extends ModalView {
model.set(this.options.attributes);
}
await this.setupLate();
if (!this.headerText) {
this.headerHtml = this.composeHeaderHtml();
}
@@ -264,6 +267,14 @@ class EditModalView extends ModalView {
});
}
/**
* Additional setup with the modal ready.
*
* @protected
* @since 9.3.0
*/
async setupLate() {}
/**
* @param {module:model} model
* @param {function} [callback]