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,7 +102,54 @@ var AIRTIME = (function(AIRTIME) {
libEmpty.hide();
}
var sortable;
if ($("#show_builder_table").is(":visible")) {
sortable = "#show_builder_table";
} else {
sortable = ".active-tab .spl_sortable";
//$('#library_display tr[class*="lib-"]')
// .draggable(
// {
// helper: function () {
//
// var $el = $(this), selected = mod
// .getChosenAudioFilesLength(), container, message,
// width = $(this).width(), height = 55;
//
// // 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 class="helper"/>').append(
// "<li/>").find("li").addClass(
// "ui-state-default").append("<div/>")
// .find("div").addClass(
// "list-item-container").append(
// message).end().width(width)
// .height(height).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: '.active-tab .spl_sortable'
// });
}
$('#library_display tr[class*="lib-"]')
.draggable(
{
@ -135,55 +182,15 @@ var AIRTIME = (function(AIRTIME) {
},
create: function(event, ui) {
$(this).draggable("option", "cursorAt", {
left: Math.floor(this.clientWidth / 2)
top: 20,
left: Math.floor($(this).outerWidth() / 2)
});
},
tolerance: 'pointer',
cursor: 'move',
distance: 25, // min-distance for dragging
connectToSortable: '#show_builder_table'
connectToSortable: sortable
});
} else {
$('#library_display tr[class*="lib-"]')
.draggable(
{
helper: function () {
var $el = $(this), selected = mod
.getChosenAudioFilesLength(), container, message,
width = $(this).width(), height = 55;
// 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 class="helper"/>').append(
"<li/>").find("li").addClass(
"ui-state-default").append("<div/>")
.find("div").addClass(
"list-item-container").append(
message).end().width(width)
.height(height).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: '.active-tab .spl_sortable'
});
}
};
mod.dblClickAdd = function(data, type) {

View File

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