mirror of
https://github.com/documize/community.git
synced 2025-07-21 14:19:43 +02:00
Allow for empty document excerpt
This commit is contained in:
parent
2d2296591b
commit
94a2e2c0f7
2 changed files with 3 additions and 6 deletions
|
@ -22,7 +22,6 @@ export default Component.extend({
|
|||
docName: '',
|
||||
docExcerpt: '',
|
||||
hasNameError: empty('docName'),
|
||||
hasExcerptError: empty('docExcerpt'),
|
||||
|
||||
canEdit: computed('permssions', 'document', function() {
|
||||
let constants = this.get('constants');
|
||||
|
@ -55,12 +54,10 @@ export default Component.extend({
|
|||
},
|
||||
|
||||
onSave() {
|
||||
if (this.get('hasNameError') || this.get('hasExcerptError')) {
|
||||
return;
|
||||
}
|
||||
if (this.get('hasNameError')) return;
|
||||
|
||||
this.set('document.name', this.get('docName'));
|
||||
this.set('document.excerpt', this.get('docExcerpt'));
|
||||
this.set('document.excerpt', this.get('docExcerpt').trim());
|
||||
this.set('editMode', false);
|
||||
|
||||
let cb = this.get('onSaveDocument');
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
{{focus-input id="document-name" type="text" value=docName class=(if hasNameError 'form-control mousetrap is-invalid' 'form-control mousetrap') placeholder="Title" autocomplete="off"}}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{textarea id="document-excerpt" rows="2" value=docExcerpt class=(if hasExcerptError 'form-control mousetrap is-invalid' 'form-control mousetrap') placeholder="Excerpt" autocomplete="off"}}
|
||||
{{textarea id="document-excerpt" rows="2" value=docExcerpt class='form-control mousetrap' placeholder="Excerpt" autocomplete="off"}}
|
||||
</div>
|
||||
<button type="button" class="btn btn-outline-secondary" {{action "onCancel"}}>Cancel</button>
|
||||
<button type="submit" class="btn btn-success" {{action "onSave"}}>Save</button>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue