From d5040677225b44117b5c9d323912d5dcd04b6f5d Mon Sep 17 00:00:00 2001 From: mrilyew <99399973+mrilyew@users.noreply.github.com> Date: Sat, 7 Dec 2024 17:48:04 +0300 Subject: [PATCH] fix(ajax): fix photo picker --- Web/static/js/al_wall.js | 2 ++ Web/static/js/router.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Web/static/js/al_wall.js b/Web/static/js/al_wall.js index c2da072c..027d0b83 100644 --- a/Web/static/js/al_wall.js +++ b/Web/static/js/al_wall.js @@ -1381,6 +1381,7 @@ u(document).on("click", "#__photoAttachment", async (e) => { // add photo u(".ovk-diag-body .attachment_selector").on("click", ".album-photo", async (ev) => { ev.preventDefault() + ev.stopPropagation() const target = u(ev.target).closest('.album-photo') const dataset = target.nodes[0].dataset @@ -1906,6 +1907,7 @@ u(document).on('click', `.vertical-attachment #small_remove_button`, (e) => { u(document).on('click', '.post-buttons .upload-item', (e) => { e.preventDefault() + e.stopPropagation() }) u(document).on('click', '.post.post-nsfw .post-content', (e) => { diff --git a/Web/static/js/router.js b/Web/static/js/router.js index 15a3a757..d8c84f0d 100644 --- a/Web/static/js/router.js +++ b/Web/static/js/router.js @@ -152,7 +152,7 @@ window.router = new class { return false } - if(!url || url == '') { + if(!url || url == '' || url == '/') { return false } @@ -315,7 +315,7 @@ u(document).on('submit', 'form', async (e) => { const url_object = new URL(url) if(method == 'get' || method == 'GET') { - url_object.searchParams.append('hash', window.router.csrf) + //url_object.searchParams.append('hash', window.router.csrf) $(form).serializeArray().forEach(param => { url_object.searchParams.append(param.name, param.value) })