1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 23:59:47 +02:00

Allow for empty document excerpt

This commit is contained in:
Harvey Kandola 2018-06-07 14:23:54 +01:00
parent 2d2296591b
commit 94a2e2c0f7
2 changed files with 3 additions and 6 deletions

View file

@ -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');