Delete catgories from DOM
This commit is contained in:
parent
7bdf03f159
commit
8f01c714e4
@ -18,19 +18,19 @@
|
||||
<tbody id="categories"></tbody>
|
||||
<script id="template" type="text/x-handlers-template">
|
||||
{{#each categories}}
|
||||
<tr>
|
||||
<tr class="category_{{id}}">
|
||||
<td class="text-left">{{description}}</td>
|
||||
<td class="text-right">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="category_{{id}}" data-categoryId="{{id}}" value="1" {{checkMatch 1}}> Agree
|
||||
</label>
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="category_{{id}}" data-categoryId="{{id}}" value="-1" {{checkMatch -1}}> Disagree
|
||||
</label>
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<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>
|
||||
</label>
|
||||
<button type="button" data-categoryId="{{id}}" class="btn btn-xs btn-danger">×</button>
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
|
@ -51,7 +51,11 @@
|
||||
}
|
||||
|
||||
function removeCategory(id) {
|
||||
alert('Delete stub');
|
||||
$.getJSON('/forget', {id: id}, function(results) {
|
||||
if (results.success) {
|
||||
$('tr.category_' + id).remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function displayCategories(categories) {
|
||||
|
Loading…
Reference in New Issue
Block a user