From 12354e7292e588a614436ff3d5b21a291fd9da29 Mon Sep 17 00:00:00 2001 From: Francisco <54645175+franciscoarocas@users.noreply.github.com> Date: Mon, 14 Sep 2020 13:15:42 +0100 Subject: [PATCH] Fixed, uploaderFiles doesnt show all namesFiles in all uploadersInputs --- admin/panels/uploader/admin.uploader.tpl | 64 ++++++++++++------------ admin/res/admin.js | 13 +++-- 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/admin/panels/uploader/admin.uploader.tpl b/admin/panels/uploader/admin.uploader.tpl index 7419c7f..a9951c2 100755 --- a/admin/panels/uploader/admin.uploader.tpl +++ b/admin/panels/uploader/admin.uploader.tpl @@ -30,7 +30,7 @@
- +
@@ -39,7 +39,7 @@
- +
@@ -48,7 +48,7 @@
- +
@@ -57,46 +57,46 @@
- +
-
- -
-
- - -
+
+ +
+
+ + +
-
- -
-
- - -
+
+ +
+
+ + +
-
- -
-
- - -
+
+ +
+
+ + +
-
- -
-
- - -
+
+ +
+
+ + +
diff --git a/admin/res/admin.js b/admin/res/admin.js index 8705875..c6ebdda 100644 --- a/admin/res/admin.js +++ b/admin/res/admin.js @@ -34,11 +34,14 @@ function mobile_open_button() { /* Functions of uploaderFiles */ /* This function is called in the admin.uploader.tpl */ function startUploadEvent() { - document.querySelector('.custom-file-input').addEventListener('change', function(e){ /* Change namefile when user select it */ - const currentInputFileID = e.srcElement.id; - const fileName = document.getElementById(currentInputFileID).files[0].name; - const nextSibling = e.target.nextElementSibling - nextSibling.innerText = fileName + const uploadInputs = document.querySelectorAll('.custom-file-input'); + uploadInputs.forEach(function(currentInput) { + currentInput.addEventListener('change', function(e){ // Change namefile when user select it + const currentInputFileID = e.srcElement.id; + const fileName = document.getElementById(currentInputFileID).files[0].name; + const nextSibling = e.target.nextElementSibling + nextSibling.innerText = fileName + }); }); } /* Functions of FileManager */