Updated plus and minus buttons in list views, addresses #202

pull/263/head
Justin Richer 2012-11-15 16:35:17 -05:00
parent 150c4032fd
commit a88ae8258a
2 changed files with 9 additions and 6 deletions

View File

@ -33,7 +33,8 @@
tagName: 'tr',
events:{
"click .icon-minus-sign":function () {
"click .btn":function (e) {
e.preventDefault();
this.$el.tooltip('destroy');
this.model.destroy();
}
@ -60,7 +61,7 @@
}),
events:{
"click button":"addItem",
"click .btn":"addItem",
"keypress input":function (e) {
// trap the enter key
if (e.which == 13) {
@ -82,7 +83,9 @@
},
addItem:function() {
addItem:function(e) {
e.preventDefault();
var input_value = $("input", this.el).val().trim();
var model;

View File

@ -245,7 +245,7 @@
<script type="text/html" id="tmpl-list-widget-child">
<td><%=(item.length > 27) ? item.substr(0,27) + '...' : item %></td>
<td><i class="icon-minus-sign icon-gray"></i></td>
<td><a class="btn btn-small" href="#"><i class="icon-minus-sign icon-gray"></i></a></td>
</script>
<script type="text/html" id="tmpl-list-widget">
@ -253,7 +253,7 @@
<tr>
<th class="control-group">
<input type="text" value="" placeholder="<%=(placeholder) ? placeholder : ''%>"></th>
<th><button class="btn btn-small" type="button">Add</button></th>
<th><a class="btn btn-small" href="#"><i class="icon-plus-sign icon-gray"></i></a></th>
</tr>
</thead>
<tbody>