Better way to disable and reenable xfade button in playlist/sb editors

This commit is contained in:
Duncan Sommerville 2015-09-08 16:56:55 -04:00
parent 8c3f1cf535
commit e6494e7ff0
3 changed files with 5 additions and 5 deletions

View file

@ -44,7 +44,7 @@ if (isset($this->obj)) {
<button class="btn" title='<?php echo _("Shuffle playlist") ?>' type="button" id="playlist_shuffle_button"><?php echo _("Shuffle") ?></button> <button class="btn" title='<?php echo _("Shuffle playlist") ?>' type="button" id="playlist_shuffle_button"><?php echo _("Shuffle") ?></button>
</div> </div>
<div class='btn-group'> <div class='btn-group'>
<button id="spl_crossfade" class="btn crossfade-main-button" <?php if ($count <= 0) echo "disabled=disabled"; ?>> <button id="spl_crossfade" class="btn crossfade-main-button">
<i class='crossfade-main-icon'></i><span class="ui-button-text"><?php echo _("Playlist crossfade") ?></span> <i class='crossfade-main-icon'></i><span class="ui-button-text"><?php echo _("Playlist crossfade") ?></span>
</button> </button>
</div> </div>

View file

@ -52,7 +52,7 @@ if (isset($this->obj)) {
<?php echo $this->form->getElement('shuffle_button');?> <?php echo $this->form->getElement('shuffle_button');?>
</div> </div>
<div class='btn-group'> <div class='btn-group'>
<button id="spl_crossfade" class="btn crossfade-main-button" <?php if (!$this->obj->isStatic() || $count <= 0) echo "disabled=disabled"; ?>> <button id="spl_crossfade" class="btn crossfade-main-button">
<i class='crossfade-main-icon'></i><span class="ui-button-text"><?php echo _("Playlist crossfade") ?></span> <i class='crossfade-main-icon'></i><span class="ui-button-text"><?php echo _("Playlist crossfade") ?></span>
</button> </button>
</div> </div>

View file

@ -406,7 +406,7 @@ var AIRTIME = (function(AIRTIME){
var empty = $pl.find(".spl_empty"); var empty = $pl.find(".spl_empty");
if (!show || empty.length > 0) { if (!show || empty.length > 0) {
//$pl.find("#spl_crossfade").hide(); $pl.find("#spl_crossfade").attr("disabled", "disabled");
} else { } else {
//get list of playlist contents //get list of playlist contents
var list = contents.children(); var list = contents.children();
@ -416,9 +416,9 @@ var AIRTIME = (function(AIRTIME){
var last = list.last(); var last = list.last();
if (first.find(':first-child').children().attr('blockid') !== undefined && if (first.find(':first-child').children().attr('blockid') !== undefined &&
last.find(':first-child').children().attr('blockid') !== undefined) { last.find(':first-child').children().attr('blockid') !== undefined) {
//$pl.find("#spl_crossfade").hide(); $pl.find("#spl_crossfade").attr("disabled", "disabled");
} else { } else {
$pl.find("#spl_crossfade").show(); $pl.find("#spl_crossfade").removeAttr("disabled");
} }
} }