0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 17:30:29 +01:00

Merge pull request #120 from paviliondev/fix-paste-event

Ensure our custom paste logic is running
Dieser Commit ist enthalten in:
Angus McLeod 2021-06-16 15:01:31 +10:00 committet von GitHub
Commit 85bb23e70f
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 6 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -4,6 +4,10 @@ export default Ember.Application.extend({
rootElement: "#custom-wizard-main", rootElement: "#custom-wizard-main",
Resolver: buildResolver("wizard"), Resolver: buildResolver("wizard"),
customEvents: {
paste: "paste",
},
start() { start() {
Object.keys(requirejs._eak_seen).forEach((key) => { Object.keys(requirejs._eak_seen).forEach((key) => {
if (/\/pre\-initializers\//.test(key)) { if (/\/pre\-initializers\//.test(key)) {

Datei anzeigen

@ -15,7 +15,7 @@ export default {
); );
const DEditor = requirejs("discourse/components/d-editor").default; const DEditor = requirejs("discourse/components/d-editor").default;
const { clipboardHelpers } = requirejs("discourse/lib/utilities"); const { clipboardHelpers } = requirejs("discourse/lib/utilities");
const { toMarkdown } = requirejs("discourse/lib/to-markdown"); const toMarkdown = requirejs("discourse/lib/to-markdown").default;
FieldComponent.reopen({ FieldComponent.reopen({
classNameBindings: ["field.id"], classNameBindings: ["field.id"],
@ -181,7 +181,7 @@ export default {
markdown = pre.match(/\S$/) ? ` ${markdown}` : markdown; markdown = pre.match(/\S$/) ? ` ${markdown}` : markdown;
} }
this.appEvents.trigger("composer:insert-text", { this.appEvents.trigger("wizard-editor:insert-text", {
fieldId: this.fieldId, fieldId: this.fieldId,
text: markdown, text: markdown,
}); });