This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new a04588bb9a ISIS-3071: workaround input nesting more broadly
a04588bb9a is described below

commit a04588bb9a10466a5522db6fb8fcdaad9ee67964
Author: Andi Huber <[email protected]>
AuthorDate: Wed Nov 16 12:53:36 2022 +0100

    ISIS-3071: workaround input nesting more broadly
    
    - however, the input gets cleared if a dependent arg changes
---
 .../causeway-file-upload-nesting-fix.nocompress.js      | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git 
a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/widgets/fileinput/causeway-file-upload-nesting-fix.nocompress.js
 
b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/widgets/fileinput/causeway-file-upload-nesting-fix.nocompress.js
index a49160a3c7..b7dd5d1956 100644
--- 
a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/widgets/fileinput/causeway-file-upload-nesting-fix.nocompress.js
+++ 
b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/widgets/fileinput/causeway-file-upload-nesting-fix.nocompress.js
@@ -19,12 +19,25 @@
 // ISIS-3071 file-input nesting issue
 let scalarFrames = document.querySelectorAll("span.uploadFile");
 scalarFrames.forEach((scalarFrame) => {
-       let fileInputFrames = 
scalarFrame.querySelectorAll("div.file-input-ajax-new");
+       let fileInputFrames = scalarFrame.querySelectorAll("div.file-input");
        let isNested = fileInputFrames.length>1;
        // replace the outermost with the innermost
        if(isNested) {
-               let outermost = fileInputFrames[0]; 
+               let outermost = fileInputFrames[0];
+               //let outermostInput = outermost.querySelector("input");
+               //let outermostPreview = 
outermost.querySelector("div.file-preview");
+               //console.log("outermostInput: " + outermostInput);
+               //console.log("outermostPreview: " + outermostPreview);
+                
                let innermost = fileInputFrames[fileInputFrames.length-1];
+               //let innermostInput = innermost.querySelector("input");
+               //let innermostPreview = 
innermost.querySelector("div.file-preview");
+               
+               //console.log("innermostInput: " + innermostInput);
+               //console.log("innermostPreview: " + innermostPreview);
+               
+               //innermostInput.parentNode.replaceChild(outermostInput, 
innermostInput);
+               //innermostPreview.parentNode.replaceChild(outermostPreview, 
innermostPreview);
                outermost.parentNode.replaceChild(innermost, outermost);
        }
 })
\ No newline at end of file

Reply via email to