1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-05 05:25:27 +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();

View file

@ -41,7 +41,7 @@
<div class="margin-top-30"><i>No categories defined yet</i></div>
{{/each}}
</div>
<div class="input-control margin-top-50">
<div class="input-control margin-top-50 width-60">
<label>Add Category</label>
<div class="tip">Provide a short name</div>
{{focus-input id="new-category-name" type="text" value=newCategory}}