|
|
@ -88,6 +88,7 @@ var ListWidgetChildView = Backbone.View.extend({ |
|
|
|
|
|
|
|
|
|
|
|
deleteItem:function (e) { |
|
|
|
deleteItem:function (e) { |
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
e.stopImmediatePropagation(); |
|
|
|
//this.$el.tooltip('delete');
|
|
|
|
//this.$el.tooltip('delete');
|
|
|
|
|
|
|
|
|
|
|
|
this.model.destroy({
|
|
|
|
this.model.destroy({
|
|
|
@ -137,6 +138,7 @@ var ListWidgetView = Backbone.View.extend({ |
|
|
|
|
|
|
|
|
|
|
|
events:{ |
|
|
|
events:{ |
|
|
|
"click .btn-add":"addItem", |
|
|
|
"click .btn-add":"addItem", |
|
|
|
|
|
|
|
"blur input": "addItem", |
|
|
|
"keypress":function (e) { |
|
|
|
"keypress":function (e) { |
|
|
|
// trap the enter key
|
|
|
|
// trap the enter key
|
|
|
|
if (e.which == 13) { |
|
|
|
if (e.which == 13) { |
|
|
@ -163,6 +165,10 @@ var ListWidgetView = Backbone.View.extend({ |
|
|
|
|
|
|
|
|
|
|
|
var input_value = $("input", this.el).val().trim(); |
|
|
|
var input_value = $("input", this.el).val().trim(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (input_value === ""){ |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var model; |
|
|
|
var model; |
|
|
|
|
|
|
|
|
|
|
|
if (this.options.type == 'uri') { |
|
|
|
if (this.options.type == 'uri') { |
|
|
|