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

edit category

This commit is contained in:
Harvey Kandola 2017-09-19 18:55:33 +01:00
parent 4874d23f15
commit ea38729f55
3 changed files with 11 additions and 3 deletions

View file

@ -78,10 +78,18 @@ export default Ember.Component.extend(NotifierMixin, {
onCancel(id) {
this.setEdit(id, false);
this.load();
},
onSave(id) {
let cat = this.setEdit(id, false);
let cat = this.setEdit(id, true);
if (cat.get('category') === '') {
$('#edit-category-' + cat.get('id')).addClass('error').focus();
return;
}
cat = this.setEdit(id, false);
$('#edit-category-' + cat.get('id')).removeClass('error');
this.get('categoryService').save(cat).then(() => {
this.load();