Disable the "Disable touch controller" setting on non-touchable devices

This commit is contained in:
redphx 2023-08-05 09:49:22 +07:00
parent e940524ab1
commit 3d3811b8f3

View File

@ -665,7 +665,7 @@ class Preferences {
}, },
}, },
[Preferences.USE_DESKTOP_CODEC]: { [Preferences.USE_DESKTOP_CODEC]: {
'label': 'Force high-quality codec (if supported)', 'label': 'Force high-quality codec',
'default': false, 'default': false,
}, },
[Preferences.PREFER_IPV6_SERVER]: { [Preferences.PREFER_IPV6_SERVER]: {
@ -1878,6 +1878,14 @@ function injectSettingsButton($parent) {
$control.disabled = true; $control.disabled = true;
$control.title = 'Your browser doesn\'t support this feature'; $control.title = 'Your browser doesn\'t support this feature';
$control.style.cursor = 'help'; $control.style.cursor = 'help';
} else if (settingId === Preferences.STREAM_HIDE_TOUCH_CONTROLLER) {
// Disable this setting for non-touchable devices
if (!('ontouchstart'in window) && navigator.maxTouchPoints === 0) {
$control.checked = false;
$control.disabled = true;
$control.title = 'Your device doesn\'t have touch support';
$control.style.cursor = 'help';
}
} }
} }