0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-14 22:02:53 +01:00
discourse-custom-wizard/assets/javascripts/discourse/components/custom-wizard-field-composer.js.es6

58 Zeilen
1 KiB
Text

import {
default as computed,
observes,
} from "discourse-common/utils/decorators";
import Component from "@ember/component";
import EmberObject, { action } from "@ember/object";
2018-02-08 05:30:55 +01:00
export default Component.extend({
2019-11-20 13:08:04 +01:00
showPreview: false,
classNameBindings: [
":wizard-field-composer",
"showPreview:show-preview:hide-preview",
],
init() {
this._super(...arguments);
this.set(
"composer",
EmberObject.create({
loading: false,
2021-12-01 08:19:14 +01:00
reply: this.get("field.value") || "",
})
);
2019-11-20 13:08:04 +01:00
},
@observes("composer.reply")
2019-11-20 13:08:04 +01:00
setField() {
this.set("field.value", this.get("composer.reply"));
2019-11-20 13:08:04 +01:00
},
@computed("showPreview")
2018-02-08 05:30:55 +01:00
togglePreviewLabel(showPreview) {
return showPreview
? "wizard_composer.hide_preview"
: "wizard_composer.show_preview";
2018-02-08 05:30:55 +01:00
},
@action
importQuote() {},
@action
groupsMentioned() {},
@action
afterRefresh() {},
@action
cannotSeeMention() {},
@action
showUploadSelector() {},
@action
togglePreview() {
this.toggleProperty("showPreview");
},
2018-02-08 05:30:55 +01:00
});