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