mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
Revert section title change on cancel operation
This commit is contained in:
parent
7b619101f1
commit
f21c80d960
2 changed files with 11 additions and 5 deletions
|
@ -27,6 +27,12 @@ export default Component.extend(TooltipMixin, ModalMixin, {
|
|||
return `page-editor-${page.id}`;
|
||||
}),
|
||||
previewText: 'Preview',
|
||||
pageTitle: '',
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
this.set('pageTitle', this.get('page.title'));
|
||||
},
|
||||
|
||||
didRender() {
|
||||
this._super(...arguments);
|
||||
|
@ -69,7 +75,7 @@ export default Component.extend(TooltipMixin, ModalMixin, {
|
|||
|
||||
actions: {
|
||||
onAction() {
|
||||
if (this.get('busy') || is.empty(this.get('page.title'))) {
|
||||
if (this.get('busy') || is.empty(this.get('pageTitle'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -78,7 +84,7 @@ export default Component.extend(TooltipMixin, ModalMixin, {
|
|||
}
|
||||
|
||||
let cb = this.get('onAction');
|
||||
cb(this.get('page.title'));
|
||||
cb(this.get('pageTitle'));
|
||||
},
|
||||
|
||||
onCancel() {
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
<div class="col-8 section-editor">
|
||||
{{#if blockMode}}
|
||||
<div class="form-group">
|
||||
{{focus-input id="page-id-{{pageId}}" value=page.title class=(if hasNameError 'form-control mousetrap form-control-lg edit-title is-invalid' 'form-control form-control-lg edit-title mousetrap') placeholder="Enter name"}}
|
||||
{{focus-input id="page-id-{{pageId}}" value=pageTitle class=(if hasNameError 'form-control mousetrap form-control-lg edit-title is-invalid' 'form-control form-control-lg edit-title mousetrap') placeholder="Enter name"}}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{textarea id="page-excerpt-{{pageId}}" value=page.excerpt rows="2" class=(if hasDescError 'form-control mousetrap form-control-lg edit-title is-invalid' 'form-control form-control-lg edit-title mousetrap') placeholder="Enter description"}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="form-group">
|
||||
{{focus-input type="text" id=pageId value=page.title class=(if hasNameError 'form-control mousetrap form-control-lg edit-title is-invalid' 'form-control form-control-lg edit-title mousetrap') placeholder="Enter name"}}
|
||||
{{focus-input type="text" id=pageId value=pageTitle class=(if hasNameError 'form-control mousetrap form-control-lg edit-title is-invalid' 'form-control form-control-lg edit-title mousetrap') placeholder="Enter name"}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue