1
0
mirror of https://github.com/SuperBFG7/ympd synced 2025-02-05 13:40:11 +00:00

Fix: don't close menu on volume down/up click

This commit is contained in:
jcorporation 2018-09-24 22:45:35 +01:00
parent 068a7b723a
commit 4540e853ff
2 changed files with 10 additions and 2 deletions

View File

@ -59,11 +59,11 @@
<h2 class="dropdown-header text-light">Volume: <span id="volumePrct"></span></h2> <h2 class="dropdown-header text-light">Volume: <span id="volumePrct"></span></h2>
<form class="px-4 py-0 pb-3" id="volumeControl"> <form class="px-4 py-0 pb-3" id="volumeControl">
<div class="btn-group"> <div class="btn-group">
<button data-href='{"cmd": "chVolume", "options": [-5]}' class="btn btn-secondary">&minus;</button> <button id="btnChVolumeDown" data-href='{"cmd": "chVolume", "options": [-5]}' class="btn btn-secondary">&minus;</button>
<div class="btn btn-secondary"> <div class="btn btn-secondary">
<input type="range" min="0" max="100" step="1" class="form-control-range" id="volumeBar"> <input type="range" min="0" max="100" step="1" class="form-control-range" id="volumeBar">
</div> </div>
<button data-href='{"cmd": "chVolume", "options": [5]}' class="btn btn-secondary">+</button> <button id="btnChVolumeUp" data-href='{"cmd": "chVolume", "options": [5]}' class="btn btn-secondary">+</button>
</div> </div>
</form> </form>
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>

View File

@ -295,6 +295,14 @@ function appInit() {
webSocketConnect(); webSocketConnect();
domCache.volumeBar.value = 0; domCache.volumeBar.value = 0;
document.getElementById('btnChVolumeDown').addEventListener('click', function(event) {
event.stopPropagation();
}, false);
document.getElementById('btnChVolumeUp').addEventListener('click', function(event) {
event.stopPropagation();
}, false);
domCache.volumeBar.addEventListener('click', function(event) { domCache.volumeBar.addEventListener('click', function(event) {
event.stopPropagation(); event.stopPropagation();
}, false); }, false);