2019-10-24 00:30:52 +08:00
|
|
|
import Component from "@ember/component";
|
2018-06-15 23:03:24 +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";
|
|
|
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
2018-03-05 08:04:23 +08:00
|
|
|
|
2019-10-24 00:30:52 +08:00
|
|
|
export default Component.extend(BufferedContent, SettingComponent, {
|
2018-06-15 23:03:24 +08:00
|
|
|
layoutName: "admin/templates/components/site-setting",
|
2019-10-28 17:33:31 +08:00
|
|
|
|
|
|
|
_save(callback) {
|
|
|
|
callback(
|
|
|
|
ajax(`/admin/themes/${this.model.id}/setting`, {
|
|
|
|
type: "PUT",
|
|
|
|
data: {
|
|
|
|
name: this.setting.setting,
|
|
|
|
value: this.get("buffered.value")
|
|
|
|
}
|
|
|
|
}).catch(popupAjaxError)
|
|
|
|
);
|
2018-03-05 08:04:23 +08:00
|
|
|
}
|
|
|
|
});
|