CC-3354 : timeline drag and drop

changing helper to say just the number of items being moved like gtalk.
This commit is contained in:
Naomi Aro 2012-02-27 16:01:05 +01:00
parent f01a872bea
commit 28759a2d34
2 changed files with 36 additions and 9 deletions

View file

@ -514,7 +514,19 @@ $(document).ready(function() {
};
fnReceive = function(event, ui) {
origTrs = ui.helper.find("tr");
var selected = $('#library_display tr:not(:first) input:checked').parents('tr'),
aItems = [];
//if nothing is checked select the dragged item.
if (selected.length === 0) {
selected = ui.item;
}
selected.each(function(i, el) {
aItems.push($(el).data("aData"));
});
origTrs = aItems;
html = ui.helper.html();
};
@ -529,10 +541,7 @@ $(document).ready(function() {
.empty()
.after(html);
origTrs.each(function(i, el){
aItemData.push($("#"+$(el).attr("id")).data("aData"));
});
aItemData = origTrs;
origTrs = undefined;
fnAdd();
}