mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-17 02:24:34 +08:00
Merge pull request #8360 from andrej-scinote/aj_SCI_11470
Fix the disabling of the publish button [SCI-11470]
This commit is contained in:
commit
a22bcdd5b7
1 changed files with 9 additions and 4 deletions
|
@ -188,11 +188,14 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
isValidChanged() {
|
||||
if (this.$refs.editField?.field) {
|
||||
const index = this.fields.findIndex((f) => f.id === this.$refs.editField.field.id);
|
||||
this.fields[index].isValid = this.$refs.editField.isValid;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.editField?.field) {
|
||||
const index = this.fields.findIndex((f) => f.id === this.$refs.editField.field.id);
|
||||
this.fields[index].isValid = this.$refs.editField.isValid;
|
||||
}
|
||||
|
||||
this.isValid = !this.fields.some((field) => field.isValid === false);
|
||||
}
|
||||
});
|
||||
},
|
||||
syncSavedFields() {
|
||||
this.savedFields = this.fields.map((f) => ({ ...f }));
|
||||
|
@ -206,6 +209,8 @@ export default {
|
|||
[this.activeField] = this.fields;
|
||||
}
|
||||
this.syncSavedFields();
|
||||
this.isValidChanged();
|
||||
|
||||
if (this.form.attributes.published_on || !this.form.attributes.urls.create_field) {
|
||||
this.preview = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue