mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 09:13:45 +08:00
DEV: make composer-upload-uppy more flexible
This commit is contained in:
parent
31db83527b
commit
db0429da1f
|
@ -9,4 +9,6 @@ export default ComposerEditor.extend(ComposerUploadUppy, {
|
|||
uploadType: "composer",
|
||||
uppyId: "composer-editor-uppy",
|
||||
composerModel: alias("composer"),
|
||||
composerModelContentKey: "reply",
|
||||
editorInputClass: ".d-editor-input",
|
||||
});
|
||||
|
|
|
@ -334,9 +334,9 @@ export default Mixin.create({
|
|||
filename: escapedFilename + "(?:\\()?([0-9])?(?:\\))?",
|
||||
})}\\]\\(\\)`;
|
||||
const globalRegex = new RegExp(regexString, "g");
|
||||
const matchingPlaceholder = this.get("composerModel.reply").match(
|
||||
globalRegex
|
||||
);
|
||||
const matchingPlaceholder = this.get(
|
||||
`composerModel.${this.composerModelContentKey}`
|
||||
).match(globalRegex);
|
||||
if (matchingPlaceholder) {
|
||||
// get last matching placeholder and its consecutive nr in regex
|
||||
// capturing group and apply +1 to the placeholder
|
||||
|
@ -525,7 +525,7 @@ export default Mixin.create({
|
|||
_bindPasteListener() {
|
||||
this.pasteEventListener = function pasteListener(event) {
|
||||
if (
|
||||
document.activeElement !== document.querySelector(".d-editor-input")
|
||||
document.activeElement !== document.querySelector(this.editorInputClass)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user