]> Untitled Git - ympd.git/commitdiff
hide volume controls when volume is not supported by the current output
authorSuperBFG7 <daniel@despite.ch>
Mon, 21 Jun 2021 07:28:34 +0000 (09:28 +0200)
committerSuperBFG7 <daniel@despite.ch>
Mon, 21 Jun 2021 07:28:34 +0000 (09:28 +0200)
htdocs/index.html
htdocs/js/mpd.js

index 4c5e951963fe01fd0520a1da846eef7f3cca84e8..169ab5aa9819be6545eb401b73125c89d4a4f806 100644 (file)
                 ></span>
               </button>
             </div>
-            <div class="btn-group" role="group">
+            <div class="btn-group" role="group" id="volume-group">
               <div class="btn btn-toolbar btn-default">
                 <span
                   id="volume-icon"
index 88d817c19ec8b452d7e6eeced5febfb8732216b0..18b5e385ec4bf281a8dd2857a2088d0de893d1fc 100644 (file)
@@ -952,11 +952,14 @@ function get_appropriate_ws_url() {
 }
 
 var updateVolumeIcon = function (volume) {
+    $('#volume-group').removeClass('hide');
     $('#volume-icon').removeClass('glyphicon-volume-off');
     $('#volume-icon').removeClass('glyphicon-volume-up');
     $('#volume-icon').removeClass('glyphicon-volume-down');
 
-    if (volume == 0) {
+    if (volume == -1) {
+        $('#volume-group').addClass('hide');
+    } else if (volume == 0) {
         $('#volume-icon').addClass('glyphicon-volume-off');
     } else if (volume < 50) {
         $('#volume-icon').addClass('glyphicon-volume-down');