diff --git a/app/assets/javascripts/app/controllers/_settings/area_item.coffee b/app/assets/javascripts/app/controllers/_settings/area_item.coffee index 94fd86a99..c7db71eb3 100644 --- a/app/assets/javascripts/app/controllers/_settings/area_item.coffee +++ b/app/assets/javascripts/app/controllers/_settings/area_item.coffee @@ -52,5 +52,4 @@ class App.SettingsAreaItem extends App.Controller value = params else value = directData - - App.Setting.set(@setting['name'], value) + App.Setting.set(@setting['name'], value, doneLocal: => @formEnable(e)) diff --git a/app/assets/javascripts/app/models/setting.coffee b/app/assets/javascripts/app/models/setting.coffee index 04bb58d12..a91ca9c5b 100644 --- a/app/assets/javascripts/app/models/setting.coffee +++ b/app/assets/javascripts/app/models/setting.coffee @@ -21,6 +21,8 @@ class App.Setting extends App.Model timeout: 2000 } App.Setting.preferencesPost(@) + if options.doneLocal + options.doneLocal(@) if !options.fail options.fail = (settings, details) -> @@ -29,6 +31,8 @@ class App.Setting extends App.Model msg: App.i18n.translateContent(details.error_human || details.error || 'Unable to update object!') timeout: 2000 } + if options.failLocal + options.failLocal(@) if setting.frontend App.Config.set(name, value) setting.save(options)