mirror of
https://github.com/SuperBFG7/ympd
synced 2024-11-23 05:17:18 +00:00
Hide output button(s) if there is only one configured output
This commit is contained in:
parent
1b0484a285
commit
2e9d477ee6
@ -496,10 +496,14 @@ function webSocketConnect() {
|
|||||||
break;
|
break;
|
||||||
case "outputnames":
|
case "outputnames":
|
||||||
$('#btn-outputs-block button').remove();
|
$('#btn-outputs-block button').remove();
|
||||||
|
if (obj.data.length > 1) {
|
||||||
$.each(obj.data, function(id, name){
|
$.each(obj.data, function(id, name){
|
||||||
var btn = $('<button id="btnoutput'+id+'" class="btn btn-default" onclick="toggleoutput(this, '+id+')"><span class="glyphicon glyphicon-volume-up"></span> '+name+'</button>');
|
var btn = $('<button id="btnoutput'+id+'" class="btn btn-default" onclick="toggleoutput(this, '+id+')"><span class="glyphicon glyphicon-volume-up"></span> '+name+'</button>');
|
||||||
btn.appendTo($('#btn-outputs-block'));
|
btn.appendTo($('#btn-outputs-block'));
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
$('#btn-outputs-block').removeClass('btn-group-vertical');
|
||||||
|
}
|
||||||
/* remove cache, since the buttons have been recreated */
|
/* remove cache, since the buttons have been recreated */
|
||||||
last_outputs = '';
|
last_outputs = '';
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user