diff --git a/share/tools/web_config/js/controllers.js b/share/tools/web_config/js/controllers.js index 01eed9d03..c1e14b8f8 100644 --- a/share/tools/web_config/js/controllers.js +++ b/share/tools/web_config/js/controllers.js @@ -127,12 +127,20 @@ controllers.controller("colorsController", function($scope, $http) { ]; var remaining = settingNames.length; for (name of settingNames) { + var selected; // Skip colors undefined in the current theme - if (!$scope.selectedColorScheme[name]) { - remaining -= 1; - continue; + // js is dumb - the empty string is false, + // but we want that to mean unsetting a var. + if (!$scope.selectedColorScheme[name] && $scope.selectedColorScheme[name] !== '') { + // Fall back onto the defaut colorscheme. + selected = color_scheme_fish_default[name]; + if (!selected && selected !== '') { + selected = ''; + } + } else { + selected = $scope.selectedColorScheme[name]; } - var postData = "what=" + name + "&color=" + $scope.selectedColorScheme[name] + "&background_color=&bold=&underline="; + var postData = "what=" + name + "&color=" + selected + "&background_color=&bold=&underline="; $http.post("set_color/", postData, { headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(data, status, headers, config) { if (status == 200) { remaining -= 1;