1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-23 15:19:42 +02:00

Specify default categories for new documents

Closes #339

All new documents will be assigned default categories.

Documents created from templates that already have categories take precedence.
This commit is contained in:
HarveyKandola 2019-11-15 14:51:52 +00:00
parent 5c1ad25dc9
commit f117e91bcb
18 changed files with 1284 additions and 1134 deletions

View file

@ -24,6 +24,7 @@ export default Component.extend(ModalMixin, Notifer, {
store: service(),
editId: '',
editName: '',
editDefault: false,
deleteId: '',
newCategory: '',
@ -127,6 +128,7 @@ export default Component.extend(ModalMixin, Notifer, {
let cat = this.get('category').findBy('id', id);
this.set('editId', cat.get('id'));
this.set('editName', cat.get('category'));
this.set('editDefault', cat.get('isDefault'));
this.modalOpen('#category-edit-modal', {show: true}, "#edit-category-id");
},
@ -155,6 +157,7 @@ export default Component.extend(ModalMixin, Notifer, {
let cat = this.get('category').findBy('id', this.get('editId'));
cat.set('category', name);
cat.set('isDefault', this.get('editDefault'));
this.modalClose('#category-edit-modal');
$('#edit-category-name').removeClass('is-invalid');