CC-3742 : Library: could be confused by carrying over selected state betwee pages
This commit is contained in:
parent
c5f9288aab
commit
08d939d736
3 changed files with 31 additions and 18 deletions
|
@ -40,22 +40,21 @@ var AIRTIME = (function(AIRTIME){
|
||||||
|
|
||||||
$('#library_display tr[id ^= "au"]').draggable({
|
$('#library_display tr[id ^= "au"]').draggable({
|
||||||
helper: function(){
|
helper: function(){
|
||||||
var selected = $('#library_display tr:not(:first) input:checked').parents('tr[id^="au"]'),
|
|
||||||
|
mod.selectItem($(this));
|
||||||
|
|
||||||
|
var 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();
|
||||||
|
|
||||||
if (selected.length === 0) {
|
if (selected === 1) {
|
||||||
selected = $(this);
|
message = "Adding "+selected+" Item.";
|
||||||
}
|
|
||||||
|
|
||||||
if (selected.length === 1) {
|
|
||||||
message = "Adding "+selected.length+" Item.";
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
message = "Adding "+selected.length+" Items.";
|
message = "Adding "+selected+" Items.";
|
||||||
}
|
}
|
||||||
|
|
||||||
container = $('<div class="helper"/>')
|
container = $('<div class="helper"/>')
|
||||||
|
|
|
@ -40,23 +40,21 @@ 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'),
|
|
||||||
|
mod.selectItem($(this));
|
||||||
|
|
||||||
|
var 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 nothing is checked select the dragged item.
|
if (selected === 1) {
|
||||||
if (selected.length === 0) {
|
message = "Adding "+selected+" Item.";
|
||||||
selected = $(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (selected.length === 1) {
|
|
||||||
message = "Adding "+selected.length+" Item.";
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
message = "Adding "+selected.length+" Items.";
|
message = "Adding "+selected+" Items.";
|
||||||
}
|
}
|
||||||
|
|
||||||
container = $('<div/>').attr('id', 'draggingContainer')
|
container = $('<div/>').attr('id', 'draggingContainer')
|
||||||
|
|
|
@ -18,6 +18,22 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
return selected;
|
return selected;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mod.getChosenAudioFilesLength = function(){
|
||||||
|
var files = Object.keys(chosenItems),
|
||||||
|
i, length,
|
||||||
|
count = 0,
|
||||||
|
reAudio=/^au/ ;
|
||||||
|
|
||||||
|
for (i = 0, length = files.length; i < length; i++) {
|
||||||
|
|
||||||
|
if (files[i].search(reAudio) !== -1) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return count;
|
||||||
|
};
|
||||||
|
|
||||||
mod.createToolbarDropDown = function() {
|
mod.createToolbarDropDown = function() {
|
||||||
|
|
||||||
$.contextMenu({
|
$.contextMenu({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue