CC-3870 : Now playing -> "Add n items" displays wrong "n" when drag and drop tracks to Time Line
This commit is contained in:
parent
0c233c3346
commit
bf614dd729
3 changed files with 23 additions and 4 deletions
|
@ -48,14 +48,20 @@ var AIRTIME = (function(AIRTIME){
|
||||||
$('#library_display tr.lib-audio').draggable({
|
$('#library_display tr.lib-audio').draggable({
|
||||||
helper: function(){
|
helper: function(){
|
||||||
|
|
||||||
var selected = mod.getChosenAudioFilesLength(),
|
var $el = $(this),
|
||||||
|
selected = mod.getChosenAudioFilesLength(),
|
||||||
container,
|
container,
|
||||||
message,
|
message,
|
||||||
li = $("#side_playlist ul li:first"),
|
li = $("#side_playlist ul li:first"),
|
||||||
width = li.width(),
|
width = li.width(),
|
||||||
height = li.height();
|
height = li.height();
|
||||||
|
|
||||||
|
//dragging an element that has an unselected checkbox.
|
||||||
|
if (mod.isChosenItem($el) === false) {
|
||||||
|
selected++;
|
||||||
|
}
|
||||||
|
|
||||||
if (selected === 0 || selected === 1) {
|
if (selected === 1) {
|
||||||
message = "Adding 1 Item.";
|
message = "Adding 1 Item.";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -48,14 +48,20 @@ var AIRTIME = (function(AIRTIME){
|
||||||
$('#library_display tr.lib-audio, tr.lib-pl').draggable({
|
$('#library_display tr.lib-audio, tr.lib-pl').draggable({
|
||||||
helper: function(){
|
helper: function(){
|
||||||
|
|
||||||
var selected = mod.getChosenItemsLength(),
|
var $el = $(this),
|
||||||
|
selected = mod.getChosenItemsLength(),
|
||||||
container,
|
container,
|
||||||
thead = $("#show_builder_table thead"),
|
thead = $("#show_builder_table thead"),
|
||||||
colspan = thead.find("th").length,
|
colspan = thead.find("th").length,
|
||||||
width = thead.find("tr:first").width(),
|
width = thead.find("tr:first").width(),
|
||||||
message;
|
message;
|
||||||
|
|
||||||
if (selected === 0 || selected === 1) {
|
//dragging an element that has an unselected checkbox.
|
||||||
|
if (mod.isChosenItem($el) === false) {
|
||||||
|
selected++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selected === 1) {
|
||||||
message = "Adding 1 Item.";
|
message = "Adding 1 Item.";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -98,6 +98,13 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mod.isChosenItem = function($el) {
|
||||||
|
var id = $el.attr("id"),
|
||||||
|
item = chosenItems[id];
|
||||||
|
|
||||||
|
return item !== undefined ? true : false;
|
||||||
|
};
|
||||||
|
|
||||||
mod.addToChosen = function($el) {
|
mod.addToChosen = function($el) {
|
||||||
var id = $el.attr("id");
|
var id = $el.attr("id");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue