diff --git a/assets/javascripts/discourse/components/custom-wizard-composer-editor.js.es6 b/assets/javascripts/discourse/components/custom-wizard-composer-editor.js.es6 index ea26cc67..4e035236 100644 --- a/assets/javascripts/discourse/components/custom-wizard-composer-editor.js.es6 +++ b/assets/javascripts/discourse/components/custom-wizard-composer-editor.js.es6 @@ -39,25 +39,11 @@ export default ComposerEditor.extend({ @on("didInsertElement") _composerEditorInit() { - const $input = $(this.element.querySelector(".d-editor-input")); + this._super(...arguments); - if (this.siteSettings.enable_mentions) { - $input.autocomplete({ - template: findRawTemplate("user-selector-autocomplete"), - dataSource: (term) => this._userSearchTerm.call(this, term), - key: "@", - transformComplete: (v) => v.username || v.name, - afterComplete: (value) => { - this.composer.set("reply", value); - scheduleOnce("afterRender", () => $input.blur().focus()); - }, - triggerRule: (textarea) => - !inCodeBlock(textarea.value, caretPosition(textarea)), - }); - } + if (this.siteSettings.mentionables_enabled) { + const $input = $(this.element.querySelector(".d-editor-input")); - const siteSettings = this.siteSettings; - if (siteSettings.mentionables_enabled) { Site.currentProp("mentionable_items", this.wizard.mentionable_items); const { SEPARATOR } = requirejs( "discourse/plugins/discourse-mentionables/discourse/lib/discourse-markdown/mentionable-items" @@ -75,15 +61,14 @@ export default ComposerEditor.extend({ }, transformComplete: (item) => item.model.slug, dataSource: (term) => - term.match(/\s/) ? null : searchMentionableItem(term, siteSettings), + term.match(/\s/) + ? null + : searchMentionableItem(term, this.siteSettings), triggerRule: (textarea) => !inCodeBlock(textarea.value, caretPosition(textarea)), }); } - $input.on("scroll", this._throttledSyncEditorAndPreviewScroll); - this._bindUploadTarget(); - const field = this.field; this.editorInputClass = `.${dasherize(field.type)}-${dasherize( field.id diff --git a/plugin.rb b/plugin.rb index c9d647cf..332285dd 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # name: discourse-custom-wizard # about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more. -# version: 2.6.9 +# version: 2.6.10 # authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos # url: https://github.com/paviliondev/discourse-custom-wizard # contact_emails: development@pavilion.tech