0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-25 10:40:28 +01:00
discourse-custom-wizard/assets/javascripts/discourse/components/custom-wizard-field-composer.js
Angus McLeod ce55b4671e Linting
2024-11-22 17:11:51 +01:00

58 Zeilen
1,1 KiB
JavaScript

import Component from "@ember/component";
import EmberObject, { action } from "@ember/object";
import {
default as computed,
observes,
} from "discourse-common/utils/decorators";
export default Component.extend({
showPreview: false,
classNameBindings: [
":wizard-field-composer",
"showPreview:show-preview:hide-preview",
],
init() {
this._super(...arguments);
this.set(
"composer",
EmberObject.create({
loading: false,
reply: this.get("field.value") || "",
afterRefresh: () => {},
})
);
},
@observes("composer.reply")
setField() {
this.set("field.value", this.get("composer.reply"));
},
@computed("showPreview")
togglePreviewLabel(showPreview) {
return showPreview
? "wizard_composer.hide_preview"
: "wizard_composer.show_preview";
},
@action
importQuote() {},
@action
groupsMentioned() {},
@action
afterRefresh() {},
@action
cannotSeeMention() {},
@action
showUploadSelector() {},
@action
togglePreview() {
this.toggleProperty("showPreview");
},
});