Viewer: Fix preferences under Scrolling behavior not being saved correctly

This commit is contained in:
Kovid Goyal 2019-10-09 11:34:34 +05:30
parent 3faa52ee58
commit 4a074eb2bf
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -54,8 +54,12 @@ develop = create_scrolling_panel
def commit_scrolling(onchange):
sd = get_session_data()
container = get_container()
changed = False
for control in container.querySelectorAll('input[name]'):
name = control.getAttribute('name')
val = control.checked
sd.set(name, None if val is defaults[name] else val)
if val is not sd.get(name):
sd.set(name, val)
changed = True
if changed:
onchange()