Viewer: Fix a regression that broke creating new color schemes

Fixes #1847407 [Unhandled error when adding new color scheme](https://bugs.launchpad.net/calibre/+bug/1847407)
This commit is contained in:
Kovid Goyal 2019-10-09 14:32:27 +05:30
parent 21df277dc4
commit 83dd9c375d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -56,14 +56,14 @@ def change_current_color(ev):
set_action_button_visibility(ul.parentNode)
def new_color_scheme(ev):
container = get_container()
container.lastChild.style.display = 'block'
for inp in container.lastChild.querySelectorAll('input'):
container = document.getElementById(EDIT_SCHEME)
container.style.display = 'block'
for inp in container.querySelectorAll('input'):
if inp.name is 'link_color_type':
inp.checked = inp.value is 'default'
else:
inp.value = {'name':'', 'bg':'#ffffff', 'fg':'#000000', 'link': '#0000ee'}[inp.name]
container.lastChild.querySelector('input').focus()
container.querySelector('input').focus()
return container
def edit_color_scheme(ev):