mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-29 20:11:32 +02:00
Use a getterSetter to manage int values in settings.
This commit is contained in:
@@ -136,7 +136,8 @@ aside#left-menu.full-size(
|
||||
label(for="fontSize") #{translate("font_size")}
|
||||
select(
|
||||
name="fontSize"
|
||||
ng-model="settings.fontSize"
|
||||
ng-model="fontSizeAsStr"
|
||||
ng-model-options="{ getterSetter: true }"
|
||||
)
|
||||
each size in ['10','11','12','13','14','16','20','24']
|
||||
option(value=size) #{size}px
|
||||
|
||||
@@ -8,6 +8,11 @@ define [
|
||||
if $scope.settings.pdfViewer not in ["pdfjs", "native"]
|
||||
$scope.settings.pdfViewer = "pdfjs"
|
||||
|
||||
$scope.fontSizeAsStr = (newVal) ->
|
||||
if newVal?
|
||||
$scope.settings.fontSize = newVal
|
||||
return $scope.settings.fontSize.toString()
|
||||
|
||||
$scope.$watch "settings.theme", (theme, oldTheme) =>
|
||||
if theme != oldTheme
|
||||
settings.saveSettings({theme: theme})
|
||||
|
||||
Reference in New Issue
Block a user