From 08dbc037080bdba346d245725790dad67686d4c6 Mon Sep 17 00:00:00 2001 From: lalka2016 <99399973+lalka2016@users.noreply.github.com> Date: Wed, 20 Sep 2023 20:46:58 +0300 Subject: [PATCH] dragon drop --- Web/static/js/al_wall.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Web/static/js/al_wall.js b/Web/static/js/al_wall.js index 5d692d6a..da4b6b33 100644 --- a/Web/static/js/al_wall.js +++ b/Web/static/js/al_wall.js @@ -181,6 +181,19 @@ function setupWallPostInputHandlers(id) { // revert to original size if it is larger (possibly changed by user) // textArea.style.height = (newHeight > originalHeight ? (newHeight + boost) : originalHeight) + "px"; }); + + u("#wall-post-input" + id).on("dragover", function(e) { + e.preventDefault() + + // todo add animation + return; + }); + + $("#wall-post-input" + id).on("drop", function(e) { + e.originalEvent.dataTransfer.dropEffect = 'move'; + fastUploadImage(id, e.originalEvent.dataTransfer.files[0]) + return; + }); } function OpenMiniature(e, photo, post, photo_id, type = "post") {