File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -96,15 +96,15 @@ The application is structured as a wizard.
96
96
</small>
97
97
</div>
98
98
</div>
99
- <div class="form-group">
99
+ <div class="form-group" id="embed-pdf-checkbox" >
100
100
<div class="form-check">
101
101
<input class="form-check-input" type="checkbox" name="embed-pdf"
102
102
id="embed-pdf">
103
103
<label class="form-check-label" for="embedPDF">Embed PDF?</label>
104
104
</div>
105
105
</div>
106
- <div class="form-group">
107
- <label>Invoice PDF <span id="invoice-pdf-required"> (*)</span> </label>
106
+ <div class="form-group" id="pdf-file-upload" >
107
+ <label>Invoice PDF (*)</label>
108
108
<div class="custom-file">
109
109
<input type="file" class="custom-file-input" id="pdf-file">
110
110
<label class="custom-file-label" for="ppdf-file">
@@ -113,7 +113,7 @@ The application is structured as a wizard.
113
113
<small class="form-text text-muted">For example
114
114
<a href="https://github.com/gflohr/e-invoice-eu/blob/main/contrib/templates/default-invoice.pdf"
115
115
target="_blank">
116
- default-invoice.yaml
116
+ default-invoice.pdf
117
117
</a>
118
118
</small>
119
119
</div>
Original file line number Diff line number Diff line change 23
23
document . getElementById ( 'json-file-upload' ) . style . display = 'block' ;
24
24
}
25
25
26
+ const showEmbedPDF = mimeType !== 'application/pdf' ;
27
+ if ( showEmbedPDF ) {
28
+ document . getElementById ( 'embed-pdf-checkbox' ) . style . display = 'block' ;
29
+ } else {
30
+ document . getElementById ( 'embed-pdf-checkbox' ) . style . display = 'none' ;
31
+ }
32
+
26
33
const embedPDF = document . getElementById ( 'embed-pdf' ) . checked ;
27
- const needPDF = mimeType === 'application/pdf' || embedPDF ;
34
+ const needPDF = mimeType === 'application/pdf' || ( embedPDF && showEmbedPDF ) ;
28
35
if ( needPDF ) {
29
- document . getElementById ( 'invoice-pdf-required' ) . style . display = 'inline' ;
30
- document . getElementById ( 'pdf-file' ) . setAttribute ( 'required' , 'required' ) ;
36
+ document . getElementById ( 'pdf-file-upload' ) . style . display = 'block' ;
31
37
} else {
32
- document . getElementById ( 'invoice-pdf-required' ) . style . display = 'none' ;
33
- document . getElementById ( 'pdf-file' ) . removeAttribute ( 'required' ) ;
38
+ document . getElementById ( 'pdf-file-upload' ) . style . display = 'none' ;
34
39
}
35
40
}
36
41
You can’t perform that action at this time.
0 commit comments