From d51e59192d66fb142347416458418d7551345f7d Mon Sep 17 00:00:00 2001 From: neobooru <50623835+neobooru@users.noreply.github.com> Date: Wed, 1 May 2024 14:38:54 +0200 Subject: [PATCH] Allow images to be pasted on the edit post page --- client/js/controls/file_dropper_control.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/js/controls/file_dropper_control.js b/client/js/controls/file_dropper_control.js index 41be3a425..8d1fa1639 100644 --- a/client/js/controls/file_dropper_control.js +++ b/client/js/controls/file_dropper_control.js @@ -48,6 +48,12 @@ class FileDropperControl extends events.EventTarget { this._urlInputNode.addEventListener("keydown", (e) => this._evtUrlInputKeyDown(e) ); + this._urlInputNode.addEventListener("paste", (e) => { + // document.onpaste is used on the post-upload page. + // And this event is used on the post edit page. + if (document.getElementById("post-upload")) return; + this._evtPaste(e) + }); } if (this._urlConfirmButtonNode) { this._urlConfirmButtonNode.addEventListener("click", (e) =>