Hide settings tooltip when menu is open

Removes the tooltip from the settings button when the settings menu is open and restores it when the menu is closed. This improves user experience by preventing the tooltip from overlapping the open menu.
This commit is contained in:
Yiannis Christodoulou 2025-10-18 21:43:24 +03:00
parent 1a080adddc
commit b2729d16aa

View File

@ -990,8 +990,12 @@ class CustomSettingsMenu extends Component {
if (btnEl) {
if (!isVisible) {
btnEl.classList.add('settings-clicked');
// Hide tooltip when menu is open
btnEl.removeAttribute('title');
} else {
btnEl.classList.remove('settings-clicked');
// Restore tooltip when menu is closed
btnEl.setAttribute('title', 'Settings');
}
}
}
@ -1011,10 +1015,12 @@ class CustomSettingsMenu extends Component {
this.refreshSubtitlesSubmenu();
}
// Mark settings button as active
// Mark settings button as active and hide tooltip
const btnEl = this.settingsButton?.el();
if (btnEl) {
btnEl.classList.add('settings-clicked');
// Hide tooltip when menu is open
btnEl.removeAttribute('title');
}
}
@ -1032,10 +1038,12 @@ class CustomSettingsMenu extends Component {
if (this.qualitySubmenu) this.qualitySubmenu.style.display = 'none';
if (this.subtitlesSubmenu) this.subtitlesSubmenu.style.display = 'none';
// Remove active state from settings button
// Remove active state from settings button and restore tooltip
const btnEl = this.settingsButton?.el();
if (btnEl) {
btnEl.classList.remove('settings-clicked');
// Restore tooltip when menu is closed
btnEl.setAttribute('title', 'Settings');
}
// Restore body scroll on mobile when closing