Adding stub for deleting categories
This commit is contained in:
parent
3dd296def2
commit
7bdf03f159
@ -22,14 +22,15 @@
|
||||
<td class="text-left">{{description}}</td>
|
||||
<td class="text-right">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="category_{{id}}" categoryId="{{id}}" value="1" {{checkMatch 1}}> Agree
|
||||
</label>
|
||||
<input type="radio" name="category_{{id}}" data-categoryId="{{id}}" value="1" {{checkMatch 1}}> Agree
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="category_{{id}}" categoryId="{{id}}" value="-1" {{checkMatch -1}}> Disagree
|
||||
</label>
|
||||
<input type="radio" name="category_{{id}}" data-categoryId="{{id}}" value="-1" {{checkMatch -1}}> Disagree
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="category_{{id}}" categoryId="{{id}}" value="0" {{checkMatch 0}}> Neither
|
||||
</label>
|
||||
<input type="radio" name="category_{{id}}" data-categoryId="{{id}}" value="0" {{checkMatch 0}}> Neither
|
||||
</label>
|
||||
<button type="button" data-categoryId="{{id}}" class="btn btn-xs btn-danger">×</button>
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
|
@ -50,12 +50,22 @@
|
||||
});
|
||||
}
|
||||
|
||||
function removeCategory(id) {
|
||||
alert('Delete stub');
|
||||
}
|
||||
|
||||
function displayCategories(categories) {
|
||||
var template = Handlebars.compile($('#template').html());
|
||||
$('#categories').append(template({categories: categories}));
|
||||
|
||||
$('#categories input:radio').change(function() {
|
||||
setProfileValue($(this).attr('categoryId'), this.value);
|
||||
setProfileValue($(this).attr('data-categoryId'), this.value);
|
||||
});
|
||||
|
||||
$('#categories button').click(function() {
|
||||
if (confirm('Are you sure you want to delete this category?')) {
|
||||
removeCategory($(this).attr('data-categoryId'));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user