CC-4243: Playlist Builder: Remove main fade block if there are no fades to set

-fixed
This commit is contained in:
denise 2012-08-17 12:56:45 -04:00
parent d473190a8c
commit e2fe6d4284
3 changed files with 27 additions and 13 deletions

View file

@ -311,11 +311,25 @@ var AIRTIME = (function(AIRTIME){
}
function setFadeIcon(){
var contents = $("#spl_sortable");
var show = contents.is(":visible");
var empty = $(".spl_empty");
if (empty.length > 0) {
if (!show || empty.length > 0) {
$("#spl_crossfade").hide();
} else {
$("#spl_crossfade").show();
//get list of playlist contents
var list = contents.children();
//if first and last items are blocks, hide the fade icon
var first = list.first();
var last = list.last();
if (first.find(':first-child').children().attr('blockid') !== undefined &&
last.find(':first-child').children().attr('blockid') !== undefined) {
$("#spl_crossfade").hide();
} else {
$("#spl_crossfade").show();
}
}
}
@ -468,7 +482,9 @@ var AIRTIME = (function(AIRTIME){
fadeOut.show();
fadeOut.empty().append(json.fadeOut);
}
$pl.find("#crossfade_main").show();
if (json.fadeIn != null || json.fadeOut != null) {
$pl.find("#crossfade_main").show();
}
}
});
}

View file

@ -239,16 +239,6 @@ function getRowIndex(ele) {
return index;
}
function setFadeIcon(){
var contents = $("#spl_sortable");
var show = contents.is(":visible");
if (show) {
$("#spl_crossfade").show();
} else {
$("#spl_crossfade").hide();
}
}
/* This function appends a '+' button for the last
* modifier row of each criteria.
* If there are no modifier rows, the '+' button