Skip to content

Commit 43c4a1e

Browse files
committed
COMPATIBILITY: composer editor compatibility updates
1 parent 41b5ba4 commit 43c4a1e

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

assets/javascripts/wizard-custom.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
//= require discourse/app/components/date-time-input
3636
//= require discourse/app/components/text-field
3737
//= require discourse/app/components/d-textarea
38+
//= require discourse/app/components/popup-input-tip
3839

3940
//= require discourse/app/templates/components/conditional-loading-spinner
4041
//= require discourse/app/templates/components/d-button

assets/javascripts/wizard/components/wizard-composer-editor.js.es6

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
on,
55
} from "discourse-common/utils/decorators";
66
import { findRawTemplate } from "discourse-common/lib/raw-templates";
7-
import { scheduleOnce, throttle } from "@ember/runloop";
7+
import { scheduleOnce } from "@ember/runloop";
88
import { caretPosition, inCodeBlock } from "discourse/lib/utilities";
99
import highlightSyntax from "discourse/lib/highlight-syntax";
1010
import { alias } from "@ember/object/computed";
@@ -30,7 +30,6 @@ export default ComposerEditor.extend({
3030
@on("didInsertElement")
3131
_composerEditorInit() {
3232
const $input = $(this.element.querySelector(".d-editor-input"));
33-
const $preview = $(this.element.querySelector(".d-editor-preview-wrapper"));
3433

3534
if (this.siteSettings.enable_mentions) {
3635
$input.autocomplete({
@@ -72,14 +71,7 @@ export default ComposerEditor.extend({
7271
});
7372
}
7473

75-
if (this._enableAdvancedEditorPreviewSync()) {
76-
this._initInputPreviewSync($input, $preview);
77-
} else {
78-
$input.on("scroll", () =>
79-
throttle(this, this._syncEditorAndPreviewScroll, $input, $preview, 20)
80-
);
81-
}
82-
74+
$input.on("scroll", this._throttledSyncEditorAndPreviewScroll);
8375
this._bindUploadTarget();
8476

8577
const wizardEventNames = ["insert-text", "replace-text"];

assets/stylesheets/wizard/wizard_custom.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
@import "common/components/buttons";
77
@import "common/d-editor";
88
@import "desktop/modal";
9+
@import "common/input_tip";
910

1011
@import "custom/base";
1112
@import "custom/wizard";

0 commit comments

Comments
 (0)