0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-12-02 13:31:09 +01:00
discourse-custom-wizard/assets/javascripts/discourse/components/custom-wizard-field-composer.js.es6

45 Zeilen
999 B
Text

import {
default as computed,
observes,
} from "discourse-common/utils/decorators";
2020-04-02 07:21:57 +02:00
import EmberObject from "@ember/object";
import Component from "@ember/component";
import { inject as service } from "@ember/service";
2018-02-08 05:30:55 +01:00
export default Component.extend({
2019-11-20 13:08:04 +01:00
showPreview: false,
composer: service(),
classNameBindings: [
":wizard-field-composer",
"showPreview:show-preview:hide-preview",
],
2019-11-20 13:08:04 +01:00
didInsertElement() {
this.set("composer.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
},
actions: {
togglePreview() {
this.toggleProperty("showPreview");
2019-11-20 13:08:04 +01:00
},
groupsMentioned() {},
afterRefresh() {},
cannotSeeMention() {},
importQuote() {},
showUploadSelector() {},
},
2018-02-08 05:30:55 +01:00
});