emposha/FCBKcomplete — Issue #104: manually triggerred event loses custom data
Author: Tino13
Created: 2011-11-17 10:24:44+00:00
State: open

when defining "onremove" handler, and triggering it like that :
$fcbkCompleteField.trigger("removeItem", [{ "value": $(this).attr('value'), "customData": "foobar" }]);
or even like that (see jquery trigger manual)
$fcbkCompleteField.trigger("removeItem", [{ "value": $(this).attr('value') }, "foobar" ]);

the "onremove" handler does not receive custom data.
The 1st case could be easyly solved by modifying

//public method to remove item
$(element).bind("removeItem", function(event, data) {
var item = holder.children('li[rel=' + data.value + ']');
if (item.length) {
removeItem(item);
}
});

this way :

//public method to remove item
$(element).bind("removeItem", function(event, data) {
var item = holder.children('li[rel=' + data.value + ']');
if (item.length) {
removeItem(item, data);
}
});

and so on...