1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fixes removeItem not passing row data to callback. (#965)

Call to .data('data') was happening after the remove() call, which
deletes the retained data. This was passing undefined back to the
callback for removeItem.

I've changed the data retrieval to a temporary variable before the
delete call.
This commit is contained in:
James Thomas 2016-08-21 23:05:53 +01:00 committed by Nick O'Leary
parent 456fc23463
commit 9ebca91775

View File

@ -164,11 +164,12 @@
$('<i/>',{class:"fa fa-remove"}).appendTo(deleteButton); $('<i/>',{class:"fa fa-remove"}).appendTo(deleteButton);
li.addClass("red-ui-editableList-item-removable"); li.addClass("red-ui-editableList-item-removable");
deleteButton.click(function() { deleteButton.click(function() {
var data = row.data('data');
li.addClass("red-ui-editableList-item-deleting") li.addClass("red-ui-editableList-item-deleting")
li.fadeOut(300, function() { li.fadeOut(300, function() {
$(this).remove(); $(this).remove();
if (that.options.removeItem) { if (that.options.removeItem) {
that.options.removeItem(row.data('data')); that.options.removeItem(data);
} }
}); });
}); });