CC-3354 : timeline drag and drop
changing helper to say just the number of items being moved like gtalk.
This commit is contained in:
parent
f01a872bea
commit
28759a2d34
|
@ -20,12 +20,30 @@ var AIRTIME = (function(AIRTIME){
|
||||||
|
|
||||||
$('#library_display tr:not(:first)').draggable({
|
$('#library_display tr:not(:first)').draggable({
|
||||||
helper: function(){
|
helper: function(){
|
||||||
var selected = $('#library_display tr:not(:first) input:checked').parents('tr');
|
var selected = $('#library_display tr:not(:first) input:checked').parents('tr'),
|
||||||
|
aItems = [],
|
||||||
|
container,
|
||||||
|
thead = $("#show_builder_table thead"),
|
||||||
|
colspan = thead.find("th").length,
|
||||||
|
width = thead.find("tr:first").width();
|
||||||
|
|
||||||
|
//if nothing is checked select the dragged item.
|
||||||
if (selected.length === 0) {
|
if (selected.length === 0) {
|
||||||
selected = $(this);
|
selected = $(this);
|
||||||
}
|
}
|
||||||
var container = $('<div/>').attr('id', 'draggingContainer');
|
|
||||||
container.append(selected.clone());
|
container = $('<div/>').attr('id', 'draggingContainer')
|
||||||
|
.append('<tr/>')
|
||||||
|
.find("tr")
|
||||||
|
.append('<td/>')
|
||||||
|
.find("td")
|
||||||
|
.attr("colspan", colspan)
|
||||||
|
.width(width)
|
||||||
|
.addClass("ui-state-highlight")
|
||||||
|
.append("Moving "+selected.length+" Items.")
|
||||||
|
.end()
|
||||||
|
.end();
|
||||||
|
|
||||||
return container;
|
return container;
|
||||||
},
|
},
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
|
|
|
@ -514,7 +514,19 @@ $(document).ready(function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
fnReceive = function(event, ui) {
|
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();
|
html = ui.helper.html();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -529,10 +541,7 @@ $(document).ready(function() {
|
||||||
.empty()
|
.empty()
|
||||||
.after(html);
|
.after(html);
|
||||||
|
|
||||||
origTrs.each(function(i, el){
|
aItemData = origTrs;
|
||||||
aItemData.push($("#"+$(el).attr("id")).data("aData"));
|
|
||||||
});
|
|
||||||
|
|
||||||
origTrs = undefined;
|
origTrs = undefined;
|
||||||
fnAdd();
|
fnAdd();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue