2018-03-05 03:04:23 +03:00
|
|
|
import BufferedContent from "discourse/mixins/buffered-content";
|
2019-10-23 12:30:52 -04:00
|
|
|
import Component from "@ember/component";
|
2018-03-05 03:04:23 +03:00
|
|
|
import SettingComponent from "admin/mixins/setting-component";
|
2019-06-21 13:49:14 -04:00
|
|
|
import { ajax } from "discourse/lib/ajax";
|
2020-02-04 15:19:17 +05:30
|
|
|
import { url } from "discourse/lib/computed";
|
2018-03-05 03:04:23 +03:00
|
|
|
|
2019-10-23 12:30:52 -04:00
|
|
|
export default Component.extend(BufferedContent, SettingComponent, {
|
2018-03-05 03:04:23 +03:00
|
|
|
layoutName: "admin/templates/components/site-setting",
|
2020-02-04 15:19:17 +05:30
|
|
|
updateUrl: url("model.id", "/admin/themes/%@/setting"),
|
2019-10-28 10:33:31 +01:00
|
|
|
|
2019-10-29 12:01:45 -05:00
|
|
|
_save() {
|
2020-02-04 15:19:17 +05:30
|
|
|
return ajax(this.updateUrl, {
|
2019-10-29 12:01:45 -05:00
|
|
|
type: "PUT",
|
|
|
|
data: {
|
|
|
|
name: this.setting.setting,
|
|
|
|
value: this.get("buffered.value"),
|
|
|
|
},
|
|
|
|
});
|
2018-03-05 03:04:23 +03:00
|
|
|
},
|
|
|
|
});
|