Load theme as a user setting; allow the user to change it; update tests.

This commit is contained in:
Paulo Reis
2018-08-27 15:25:00 +01:00
parent 2fbcaebac7
commit efc926ffc5
14 changed files with 53 additions and 21 deletions
+1 -1
View File
@@ -185,7 +185,7 @@ define [
"twilight", "vibrant_ink"
]
$scope.darkTheme = false
$scope.$watch "settings.theme", (theme) ->
$scope.$watch "settings.editorTheme", (theme) ->
if theme in DARK_THEMES
$scope.darkTheme = true
else
@@ -28,6 +28,7 @@ define [
@redrawAnnotations()
@$scope.$watch "theme", (value) =>
console.log value
@redrawAnnotations()
@editor.on "mousemove", (e) =>
@@ -19,9 +19,13 @@ define [
$scope.settings.fontSize = newVal
return $scope.settings.fontSize.toString()
$scope.$watch "settings.theme", (theme, oldTheme) =>
if theme != oldTheme
settings.saveSettings({theme: theme})
$scope.$watch "settings.editorTheme", (editorTheme, oldEditorTheme) =>
if editorTheme != oldEditorTheme
settings.saveSettings({editorTheme})
$scope.$watch "settings.overallTheme", (overallTheme, oldOverallTheme) =>
if overallTheme != oldOverallTheme
settings.saveSettings({overallTheme})
$scope.$watch "settings.fontSize", (fontSize, oldFontSize) =>
if fontSize != oldFontSize