From 0e7be6392d795975a6b6d49038908cf9f15dd188 Mon Sep 17 00:00:00 2001 From: Alex Ling Date: Tue, 16 Jun 2020 06:04:43 +0000 Subject: [PATCH] Fix incorrect modal colors on the reader page --- public/js/theme.js | 11 ++++++++--- src/views/reader.ecr | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/public/js/theme.js b/public/js/theme.js index 1ac121b..efdd16c 100644 --- a/public/js/theme.js +++ b/public/js/theme.js @@ -22,8 +22,7 @@ const setTheme = themeStr => { $('.uk-card').addClass('uk-card-secondary'); $('.uk-card').removeClass('uk-card-default'); $('.ui-widget-content').addClass('dark'); - } - else { + } else { $('html').css('background', ''); $('body').removeClass('uk-light'); $('.uk-card').removeClass('uk-card-secondary'); @@ -39,5 +38,11 @@ const styleModal = () => { $('.uk-modal-footer').css('background', color); }; -// do it before document is ready to prevent the initial flash of white +// do it before document is ready to prevent the initial flash of white on +// most pages setTheme(getTheme()); + +$(() => { + // hack for the reader page + setTheme(getTheme()); +}); diff --git a/src/views/reader.ecr b/src/views/reader.ecr index d62513c..9e9c0e4 100644 --- a/src/views/reader.ecr +++ b/src/views/reader.ecr @@ -4,7 +4,6 @@ <%= render_component "head" %> -
<%- urls.each_with_index do |url, i| -%>