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
|
|
|
|
|
|
|
export default Ember.Component.extend(BufferedContent, SettingComponent, {
|
2018-06-15 23:03:24 +08:00
|
|
|
layoutName: "admin/templates/components/site-setting",
|
2018-03-05 08:04:23 +08:00
|
|
|
_save() {
|
2019-06-22 01:49:14 +08:00
|
|
|
return 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
|
|
|
}
|
|
|
|
});
|