1
0
Fork 0

COMPATIBILITY: composer editor compatibility updates

Dieser Commit ist enthalten in:
angusmcleod 2021-12-22 16:41:38 +08:00
Ursprung 41b5ba4f31
Commit 43c4a1e0d6
3 geänderte Dateien mit 4 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -35,6 +35,7 @@
//= require discourse/app/components/date-time-input //= require discourse/app/components/date-time-input
//= require discourse/app/components/text-field //= require discourse/app/components/text-field
//= require discourse/app/components/d-textarea //= require discourse/app/components/d-textarea
//= require discourse/app/components/popup-input-tip
//= require discourse/app/templates/components/conditional-loading-spinner //= require discourse/app/templates/components/conditional-loading-spinner
//= require discourse/app/templates/components/d-button //= require discourse/app/templates/components/d-button

Datei anzeigen

@ -4,7 +4,7 @@ import {
on, on,
} from "discourse-common/utils/decorators"; } from "discourse-common/utils/decorators";
import { findRawTemplate } from "discourse-common/lib/raw-templates"; import { findRawTemplate } from "discourse-common/lib/raw-templates";
import { scheduleOnce, throttle } from "@ember/runloop"; import { scheduleOnce } from "@ember/runloop";
import { caretPosition, inCodeBlock } from "discourse/lib/utilities"; import { caretPosition, inCodeBlock } from "discourse/lib/utilities";
import highlightSyntax from "discourse/lib/highlight-syntax"; import highlightSyntax from "discourse/lib/highlight-syntax";
import { alias } from "@ember/object/computed"; import { alias } from "@ember/object/computed";
@ -30,7 +30,6 @@ export default ComposerEditor.extend({
@on("didInsertElement") @on("didInsertElement")
_composerEditorInit() { _composerEditorInit() {
const $input = $(this.element.querySelector(".d-editor-input")); const $input = $(this.element.querySelector(".d-editor-input"));
const $preview = $(this.element.querySelector(".d-editor-preview-wrapper"));
if (this.siteSettings.enable_mentions) { if (this.siteSettings.enable_mentions) {
$input.autocomplete({ $input.autocomplete({
@ -72,14 +71,7 @@ export default ComposerEditor.extend({
}); });
} }
if (this._enableAdvancedEditorPreviewSync()) { $input.on("scroll", this._throttledSyncEditorAndPreviewScroll);
this._initInputPreviewSync($input, $preview);
} else {
$input.on("scroll", () =>
throttle(this, this._syncEditorAndPreviewScroll, $input, $preview, 20)
);
}
this._bindUploadTarget(); this._bindUploadTarget();
const wizardEventNames = ["insert-text", "replace-text"]; const wizardEventNames = ["insert-text", "replace-text"];

Datei anzeigen

@ -6,6 +6,7 @@
@import "common/components/buttons"; @import "common/components/buttons";
@import "common/d-editor"; @import "common/d-editor";
@import "desktop/modal"; @import "desktop/modal";
@import "common/input_tip";
@import "custom/base"; @import "custom/base";
@import "custom/wizard"; @import "custom/wizard";