mirror of
https://github.com/documize/community.git
synced 2025-07-24 07:39:43 +02:00
edit category
This commit is contained in:
parent
4874d23f15
commit
ea38729f55
3 changed files with 11 additions and 3 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue