parent
59e4ed9868
commit
88e0a0bbfa
3 changed files with 18 additions and 6 deletions
|
|
@ -455,16 +455,23 @@ function renderChannels() {
|
|||
slider.addEventListener('click', (e) => e.stopPropagation());
|
||||
}
|
||||
|
||||
// Show slider on right click
|
||||
pRow.addEventListener('contextmenu', (e) => {
|
||||
const toggleVolumeSlider = (e) => {
|
||||
if (p.user_id === state.me.id) return;
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (state.voice.visibleVolumeSliders.has(p.user_id)) {
|
||||
state.voice.visibleVolumeSliders.delete(p.user_id);
|
||||
} else {
|
||||
state.voice.visibleVolumeSliders.add(p.user_id);
|
||||
}
|
||||
renderChannels();
|
||||
};
|
||||
|
||||
// Electron can swallow contextmenu events on some platforms; use
|
||||
// right-button mousedown as a reliable fallback for slider toggle.
|
||||
pRow.addEventListener('contextmenu', toggleVolumeSlider);
|
||||
pRow.addEventListener('mousedown', (e) => {
|
||||
if (e.button === 2) toggleVolumeSlider(e);
|
||||
});
|
||||
|
||||
pList.appendChild(pRow);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
"productName": "Chattz",
|
||||
"linux": {
|
||||
"target": [
|
||||
"rpm"
|
||||
"AppImage"
|
||||
],
|
||||
"category": "Chat",
|
||||
"icon": "build/icon.png"
|
||||
|
|
@ -56,4 +56,4 @@
|
|||
"dependencies": {
|
||||
"electron-updater": "^6.8.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -407,16 +407,21 @@ function renderChannels() {
|
|||
slider.addEventListener('click', (e) => e.stopPropagation());
|
||||
}
|
||||
|
||||
// Show slider on right click
|
||||
pRow.addEventListener('contextmenu', (e) => {
|
||||
const toggleVolumeSlider = (e) => {
|
||||
if (p.user_id === state.me.id) return;
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (state.voice.visibleVolumeSliders.has(p.user_id)) {
|
||||
state.voice.visibleVolumeSliders.delete(p.user_id);
|
||||
} else {
|
||||
state.voice.visibleVolumeSliders.add(p.user_id);
|
||||
}
|
||||
renderChannels();
|
||||
};
|
||||
|
||||
pRow.addEventListener('contextmenu', toggleVolumeSlider);
|
||||
pRow.addEventListener('mousedown', (e) => {
|
||||
if (e.button === 2) toggleVolumeSlider(e);
|
||||
});
|
||||
|
||||
pList.appendChild(pRow);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue