overleaf/services/web/public/coffee/app/ide/settings/SettingsManager.coffee
2014-06-24 20:28:53 +01:00

12 lines
336 B
CoffeeScript

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