fix slider
All checks were successful
/ upload (release) Successful in 3m22s

This commit is contained in:
pavel 2026-02-26 23:17:03 +01:00
commit 77a9f5ee88
4 changed files with 88 additions and 12 deletions

View file

@ -417,13 +417,10 @@ function renderChannels() {
if (p.user_id !== state.me.id) {
const vol = state.userVolumes.get(p.user_id) ?? 1.0;
sliderHtml = `
<div class="user-volume-control" style="width: 100%; display: flex; align-items: center; gap: 8px; padding-left: 28px; margin-top: 2px;">
<div class="user-volume-control" data-user-id="${p.user_id}">
<i data-lucide="volume-2" style="width: 12px; height: 12px; opacity: 0.6;"></i>
<input type="range" min="0" max="2" step="0.1" value="${vol}"
class="volume-slider"
data-user-id="${p.user_id}"
style="flex: 1; height: 4px; cursor: pointer;">
<span class="vol-pct" style="font-size: 10px; opacity: 0.6; min-width: 25px;">${Math.round(vol * 100)}%</span>
<input type="range" min="0" max="2" step="0.1" value="${vol}" class="volume-slider">
<span class="vol-pct">${Math.round(vol * 100)}%</span>
</div>
`;
}
@ -453,6 +450,16 @@ function renderChannels() {
slider.addEventListener('click', (e) => e.stopPropagation());
}
// Show slider on right click
pRow.addEventListener('contextmenu', (e) => {
if (p.user_id === state.me.id) return;
e.preventDefault();
const control = pRow.querySelector('.user-volume-control');
if (control) {
control.classList.toggle('show-volume');
}
});
pList.appendChild(pRow);
}
el.voiceChannelList.appendChild(pList);