mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-23 01:23:59 +00:00
Track settings changes.
This commit is contained in:
parent
304529754d
commit
96f6603bd3
1 changed files with 19 additions and 1 deletions
|
@ -1,19 +1,37 @@
|
|||
define [
|
||||
"base"
|
||||
], (App) ->
|
||||
App.factory "settings", ["ide", (ide) ->
|
||||
App.factory "settings", ["ide", "event_tracking", (ide, event_tracking) ->
|
||||
return {
|
||||
saveSettings: (data) ->
|
||||
for key in Object.keys(data)
|
||||
changedSetting = key
|
||||
changedSettingVal = data[key]
|
||||
event_tracking.send "setting-changed", { changedSetting, changedSettingVal }
|
||||
|
||||
data._csrf = window.csrfToken
|
||||
ide.$http.post "/user/settings", data
|
||||
|
||||
|
||||
saveProjectSettings: (data) ->
|
||||
for key in Object.keys(data)
|
||||
changedSetting = key
|
||||
changedSettingVal = data[key]
|
||||
event_tracking.send "project-setting-changed", { changedSetting, changedSettingVal}
|
||||
|
||||
data._csrf = window.csrfToken
|
||||
ide.$http.post "/project/#{ide.project_id}/settings", data
|
||||
|
||||
|
||||
saveProjectAdminSettings: (data) ->
|
||||
for key in Object.keys(data)
|
||||
changedSetting = key
|
||||
changedSettingVal = data[key]
|
||||
event_tracking.send "project-admin-setting-changed", { changedSetting, changedSettingVal }
|
||||
|
||||
data._csrf = window.csrfToken
|
||||
ide.$http.post "/project/#{ide.project_id}/settings/admin", data
|
||||
|
||||
|
||||
}
|
||||
]
|
Loading…
Reference in a new issue