mirror of
https://github.com/documize/community.git
synced 2025-07-20 13:49:42 +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}`;
|
return `page-editor-${page.id}`;
|
||||||
}),
|
}),
|
||||||
previewText: 'Preview',
|
previewText: 'Preview',
|
||||||
|
pageTitle: '',
|
||||||
|
|
||||||
|
didReceiveAttrs() {
|
||||||
|
this._super(...arguments);
|
||||||
|
this.set('pageTitle', this.get('page.title'));
|
||||||
|
},
|
||||||
|
|
||||||
didRender() {
|
didRender() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
@ -69,7 +75,7 @@ export default Component.extend(TooltipMixin, ModalMixin, {
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
onAction() {
|
onAction() {
|
||||||
if (this.get('busy') || is.empty(this.get('page.title'))) {
|
if (this.get('busy') || is.empty(this.get('pageTitle'))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +84,7 @@ export default Component.extend(TooltipMixin, ModalMixin, {
|
||||||
}
|
}
|
||||||
|
|
||||||
let cb = this.get('onAction');
|
let cb = this.get('onAction');
|
||||||
cb(this.get('page.title'));
|
cb(this.get('pageTitle'));
|
||||||
},
|
},
|
||||||
|
|
||||||
onCancel() {
|
onCancel() {
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
<div class="col-8 section-editor">
|
<div class="col-8 section-editor">
|
||||||
{{#if blockMode}}
|
{{#if blockMode}}
|
||||||
<div class="form-group">
|
<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>
|
||||||
<div class="form-group">
|
<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"}}
|
{{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>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="form-group">
|
<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>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue