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