adding a button to the detail to explicitly save changes.

This commit is contained in:
zadam
2020-07-23 00:19:50 +02:00
parent 2c9565b4b3
commit aa4a645670
4 changed files with 21 additions and 4 deletions

View File

@@ -121,6 +121,8 @@ const TPL = `
</tr>
</table>
<button class="btn btn-primary btn-sm attr-save-changes-and-close-button" style="width: 100%; margin-top: 15px;">Save & close</button>
<div class="related-notes-container">
<br/>
@@ -199,6 +201,13 @@ export default class AttributeDetailWidget extends BasicWidget {
this.$closeAttrDetailButton = this.$widget.find('.close-attr-detail-button');
this.$attrIsOwnedBy = this.$widget.find('.attr-is-owned-by');
this.$saveAndCloseButton = this.$widget.find('.attr-save-changes-and-close-button');
this.$saveAndCloseButton.on('click', async () => {
await this.triggerCommand('saveAttributes');
this.hide();
});
this.$closeAttrDetailButton.on('click', () => this.hide());
$(window).on('mouseup', e => {
@@ -388,6 +397,10 @@ export default class AttributeDetailWidget extends BasicWidget {
if (this.attrType === 'label-definition') {
props.push(this.$attrInputLabelType.val());
if (this.$attrInputLabelType.val() === 'number' && this.$attrInputNumberPrecision.val() !== '') {
props.push('precision=' + this.$attrInputNumberPrecision.val());
}
} else if (this.attrType === 'relation-definition' && this.$attrInputInverseRelation.val().trim().length > 0) {
props.push("inverse=" + this.$attrInputInverseRelation.val());
}