From 63965092a7ab135b06a935371a1f8104123d851c Mon Sep 17 00:00:00 2001 From: Greg Royal Date: Mon, 19 Aug 2019 13:55:44 -0600 Subject: [PATCH] feat(theming): fixed colorblind themes when adding an exception theme --- src/os/config/themesettings.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/os/config/themesettings.js b/src/os/config/themesettings.js index 3d9639a8d..0952b4508 100644 --- a/src/os/config/themesettings.js +++ b/src/os/config/themesettings.js @@ -265,10 +265,19 @@ os.config.ThemeSettings.setTheme = function() { os.settings.set(os.config.ThemeSettings.Keys.ACCESSIBLE_THEME, accessibleTheme); } - var theme = goog.object.findValue(os.config.ThemeSettings.themeExceptions, function(value, key) { + var theme = null; + var exceptionTheme = goog.object.findValue(os.config.ThemeSettings.themeExceptions, function(value, key) { return window.location.hash.indexOf(key) != -1; }); - if (accessibleTheme && accessibleThemes[displayTheme]) { + + if (exceptionTheme) { + if (accessibleTheme && accessibleThemes[exceptionTheme]) { + // Get this flavor of the theme + theme = accessibleThemes[exceptionTheme][accessibleTheme]; + } else { + theme = accessibleThemes[exceptionTheme]['Normal']; + } + } else if (accessibleTheme && accessibleThemes[displayTheme]) { // Get this flavor of the theme theme = accessibleThemes[displayTheme][accessibleTheme]; }