CC-4243: Playlist Builder: Remove main fade block if there are no fades to set
-fixed
This commit is contained in:
parent
d473190a8c
commit
e2fe6d4284
|
@ -2,14 +2,22 @@
|
||||||
if (isset($this->obj)) {
|
if (isset($this->obj)) {
|
||||||
$contents = $this->obj->getContents();
|
$contents = $this->obj->getContents();
|
||||||
$count = count($contents);
|
$count = count($contents);
|
||||||
|
$displayFades = true;
|
||||||
|
if ($count > 0) {
|
||||||
|
if ($contents[0]['type'] == 2 && $contents[$count-1]['type'] == 2) {
|
||||||
|
$displayFades = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<button id="spl_new" class="ui-button ui-widget ui-state-default" role="button" aria-disabled="false">New</button>
|
<button id="spl_new" class="ui-button ui-widget ui-state-default" role="button" aria-disabled="false">New</button>
|
||||||
<?php if (isset($this->obj)) : ?>
|
<?php if (isset($this->obj)) : ?>
|
||||||
<button id="spl_delete" class="ui-button ui-widget ui-state-default" role="button" aria-disabled="false">Delete</button>
|
<button id="spl_delete" class="ui-button ui-widget ui-state-default" role="button" aria-disabled="false">Delete</button>
|
||||||
|
<?php if ($displayFades) :?>
|
||||||
<a href="#" id="spl_crossfade" class="ui-button ui-button-icon-only ui-widget ui-state-default crossfade-main-button" style="display:<?php echo $count > 0 ?"block;":"none;"?>">
|
<a href="#" id="spl_crossfade" class="ui-button ui-button-icon-only ui-widget ui-state-default crossfade-main-button" style="display:<?php echo $count > 0 ?"block;":"none;"?>">
|
||||||
<span class="ui-icon crossfade-main-icon"></span><span class="ui-button-text">Playlist crossfade</span>
|
<span class="ui-icon crossfade-main-icon"></span><span class="ui-button-text">Playlist crossfade</span>
|
||||||
</a>
|
</a>
|
||||||
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if (isset($this->obj)) : ?>
|
<?php if (isset($this->obj)) : ?>
|
||||||
|
|
|
@ -311,11 +311,25 @@ var AIRTIME = (function(AIRTIME){
|
||||||
}
|
}
|
||||||
|
|
||||||
function setFadeIcon(){
|
function setFadeIcon(){
|
||||||
|
var contents = $("#spl_sortable");
|
||||||
|
var show = contents.is(":visible");
|
||||||
var empty = $(".spl_empty");
|
var empty = $(".spl_empty");
|
||||||
if (empty.length > 0) {
|
|
||||||
|
if (!show || empty.length > 0) {
|
||||||
$("#spl_crossfade").hide();
|
$("#spl_crossfade").hide();
|
||||||
} else {
|
} 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.show();
|
||||||
fadeOut.empty().append(json.fadeOut);
|
fadeOut.empty().append(json.fadeOut);
|
||||||
}
|
}
|
||||||
$pl.find("#crossfade_main").show();
|
if (json.fadeIn != null || json.fadeOut != null) {
|
||||||
|
$pl.find("#crossfade_main").show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,16 +239,6 @@ function getRowIndex(ele) {
|
||||||
return index;
|
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
|
/* This function appends a '+' button for the last
|
||||||
* modifier row of each criteria.
|
* modifier row of each criteria.
|
||||||
* If there are no modifier rows, the '+' button
|
* If there are no modifier rows, the '+' button
|
||||||
|
|
Loading…
Reference in New Issue