From 83dd9c375dd0bee8ceb420259c82cda4eb7bcaf8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 9 Oct 2019 14:32:27 +0530 Subject: [PATCH] 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) --- src/pyj/read_book/prefs/colors.pyj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pyj/read_book/prefs/colors.pyj b/src/pyj/read_book/prefs/colors.pyj index 270bb73d38..b0c25fb49a 100644 --- a/src/pyj/read_book/prefs/colors.pyj +++ b/src/pyj/read_book/prefs/colors.pyj @@ -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):