From 994ca902cad6bf210b329b1b407b141ed0521d84 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Sun, 13 Nov 2022 08:16:42 -0600 Subject: [PATCH] uploads: fix paste to upload on firefox --- files/assets/js/comments_v.js | 2 +- files/assets/js/settings_profile.js | 2 +- files/assets/js/submit.js | 2 +- files/templates/submit_hats.html | 2 +- files/templates/submit_marseys.html | 2 +- files/templates/update_assets.html | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/files/assets/js/comments_v.js b/files/assets/js/comments_v.js index f36ad93fb..acc8e586c 100644 --- a/files/assets/js/comments_v.js +++ b/files/assets/js/comments_v.js @@ -264,7 +264,7 @@ function post_comment(fullname, hide){ document.onpaste = function(event) { var focused = document.activeElement; - const files = event.clipboardData.files + const files = structuredClone(event.clipboardData.files); if (files.length > 4) { diff --git a/files/assets/js/settings_profile.js b/files/assets/js/settings_profile.js index bbe6f1e99..bbc2d5ee8 100644 --- a/files/assets/js/settings_profile.js +++ b/files/assets/js/settings_profile.js @@ -87,7 +87,7 @@ function updatebgselection(){ document.onpaste = function(event) { var focused = document.activeElement; if (focused.id == 'bio-text') { - const files = event.clipboardData.files + const files = structuredClone(event.clipboardData.files); if (files.length > 4) { diff --git a/files/assets/js/submit.js b/files/assets/js/submit.js index 8dd91e444..bc35d697d 100644 --- a/files/assets/js/submit.js +++ b/files/assets/js/submit.js @@ -55,7 +55,7 @@ function hide_image() { } document.onpaste = function(event) { - files = event.clipboardData.files + files = structuredClone(event.clipboardData.files); if (files.length > 4) { diff --git a/files/templates/submit_hats.html b/files/templates/submit_hats.html index 5a5245a45..75b674e2e 100644 --- a/files/templates/submit_hats.html +++ b/files/templates/submit_hats.html @@ -74,7 +74,7 @@