1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add option to enable smooth scroll

This commit is contained in:
Dmitry Lyzo 2024-03-25 01:16:33 +03:00
parent ba0e227b17
commit 639f99f82a
5 changed files with 30 additions and 2 deletions

View file

@ -14,6 +14,13 @@
<div class="fieldDescription checkboxFieldDescription">${EnableGamepadHelp}</div>
<div class="fieldDescription checkboxFieldDescription">${LabelPleaseRestart}</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription smoothScrollContainer hide">
<label>
<input type="checkbox" is="emby-checkbox" class="chkSmoothScroll" />
<span>${EnableSmoothScroll}</span>
</label>
</div>
</div>
<button is="emby-button" type="submit" class="raised button-submit block btnSave hide">

View file

@ -1,3 +1,4 @@
import layoutManager from 'components/layoutManager';
import toast from '../../../components/toast/toast';
import globalize from '../../../scripts/globalize';
import appSettings from '../../../scripts/settings/appSettings';
@ -6,6 +7,7 @@ import Events from '../../../utils/events.ts';
export default function (view) {
function submit(e) {
appSettings.enableGamepad(view.querySelector('.chkEnableGamepad').checked);
appSettings.enableSmoothScroll(view.querySelector('.chkSmoothScroll').checked);
toast(globalize.translate('SettingsSaved'));
@ -17,7 +19,11 @@ export default function (view) {
}
view.addEventListener('viewshow', function () {
view.querySelector('.smoothScrollContainer').classList.toggle('hide', !layoutManager.tv);
view.querySelector('.chkEnableGamepad').checked = appSettings.enableGamepad();
view.querySelector('.chkSmoothScroll').checked = appSettings.enableSmoothScroll();
view.querySelector('form').addEventListener('submit', submit);
view.querySelector('.btnSave').classList.remove('hide');