overleaf/services/web/public/coffee/app/ide/settings/SettingsManager.coffee

13 lines
336 B
CoffeeScript
Raw Normal View History

2014-06-24 15:28:53 -04:00
define [], () ->
class SettingsManager
constructor: (@ide, @$scope) ->
@$scope.settings = window.userSettings
@$scope.$watch "settings.theme", (theme, oldTheme) =>
if theme != oldTheme
@saveSettings({theme: theme})
saveSettings: (data) ->
data._csrf = window.csrfToken
@ide.$http.post "/user/settings", data