SAAS-1088 - fix broken 'all my shows' checkbox

This commit is contained in:
Duncan Sommerville 2015-09-29 15:51:09 -04:00
parent 3fcc3c507a
commit 3df1081c60
2 changed files with 89 additions and 80 deletions

View File

@ -102,88 +102,95 @@ var AIRTIME = (function(AIRTIME) {
libEmpty.hide(); libEmpty.hide();
} }
var sortable;
if ($("#show_builder_table").is(":visible")) { if ($("#show_builder_table").is(":visible")) {
$('#library_display tr[class*="lib-"]') sortable = "#show_builder_table";
.draggable(
{
helper: function () {
var $el = $(this), selected = mod
.getChosenItemsLength(), container, thead = $("#show_builder_table thead"), colspan = thead
.find("th").length, width = $el.width(), message;
// dragging an element that has an unselected
// checkbox.
if (mod.isChosenItem($el) === false) {
selected++;
}
if (selected === 1) {
message = $.i18n._("Adding 1 Item");
} else {
message = sprintf($.i18n._("Adding %s Items"), selected);
}
container = $('<div/>').attr('id',
'draggingContainer').append('<tr/>')
.find("tr").append('<td/>').find("td")
.attr("colspan", colspan).width(width)
.addClass("ui-state-highlight").append(
message).end().end();
return container;
},
create: function(event, ui) {
$(this).draggable("option", "cursorAt", {
left: Math.floor(this.clientWidth / 2)
});
},
cursor: 'move',
distance: 25, // min-distance for dragging
connectToSortable: '#show_builder_table'
});
} else { } else {
$('#library_display tr[class*="lib-"]') sortable = ".active-tab .spl_sortable";
.draggable( //$('#library_display tr[class*="lib-"]')
{ // .draggable(
helper: function () { // {
// helper: function () {
var $el = $(this), selected = mod //
.getChosenAudioFilesLength(), container, message, // var $el = $(this), selected = mod
width = $(this).width(), height = 55; // .getChosenAudioFilesLength(), container, message,
// width = $(this).width(), height = 55;
// dragging an element that has an unselected //
// checkbox. // // dragging an element that has an unselected
if (mod.isChosenItem($el) === false) { // // checkbox.
selected++; // if (mod.isChosenItem($el) === false) {
} // selected++;
// }
if (selected === 1) { //
message = $.i18n._("Adding 1 Item"); // if (selected === 1) {
} else { // message = $.i18n._("Adding 1 Item");
message = sprintf($.i18n._("Adding %s Items"), selected); // } else {
} // message = sprintf($.i18n._("Adding %s Items"), selected);
// }
container = $('<div class="helper"/>').append( //
"<li/>").find("li").addClass( // container = $('<div class="helper"/>').append(
"ui-state-default").append("<div/>") // "<li/>").find("li").addClass(
.find("div").addClass( // "ui-state-default").append("<div/>")
"list-item-container").append( // .find("div").addClass(
message).end().width(width) // "list-item-container").append(
.height(height).end(); // message).end().width(width)
// .height(height).end();
return container; //
}, // return container;
create: function(event, ui) { // },
$(this).draggable("option", "cursorAt", { // create: function(event, ui) {
left: Math.floor(this.clientWidth / 2) // $(this).draggable("option", "cursorAt", {
}); // left: Math.floor(this.clientWidth / 2)
}, // });
cursor: 'move', // },
distance: 25, // min-distance for dragging // cursor: 'move',
connectToSortable: '.active-tab .spl_sortable' // distance: 25, // min-distance for dragging
}); // connectToSortable: '.active-tab .spl_sortable'
// });
} }
$('#library_display tr[class*="lib-"]')
.draggable(
{
helper: function () {
var $el = $(this), selected = mod
.getChosenItemsLength(), container, thead = $("#show_builder_table thead"), colspan = thead
.find("th").length, width = $el.width(), message;
// dragging an element that has an unselected
// checkbox.
if (mod.isChosenItem($el) === false) {
selected++;
}
if (selected === 1) {
message = $.i18n._("Adding 1 Item");
} else {
message = sprintf($.i18n._("Adding %s Items"), selected);
}
container = $('<div/>').attr('id',
'draggingContainer').append('<tr/>')
.find("tr").append('<td/>').find("td")
.attr("colspan", colspan).width(width)
.addClass("ui-state-highlight").append(
message).end().end();
return container;
},
create: function(event, ui) {
$(this).draggable("option", "cursorAt", {
top: 20,
left: Math.floor($(this).outerWidth() / 2)
});
},
tolerance: 'pointer',
cursor: 'move',
distance: 25, // min-distance for dragging
connectToSortable: sortable
});
}; };
mod.dblClickAdd = function(data, type) { mod.dblClickAdd = function(data, type) {

View File

@ -93,6 +93,8 @@ AIRTIME = (function(AIRTIME) {
check; check;
check = validateTimeRange(); check = validateTimeRange();
console.log(check);
if (check.isValid) { if (check.isValid) {
//reset timestamp value since input values could have changed. //reset timestamp value since input values could have changed.
@ -102,7 +104,7 @@ AIRTIME = (function(AIRTIME) {
fn.start = check.start; fn.start = check.start;
fn.end = check.end; fn.end = check.end;
op = $("div.sb-advanced-options"); op = $("div.sb-options-form");
if (op.is(":visible")) { if (op.is(":visible")) {
if (fn.ops === undefined) { if (fn.ops === undefined) {