File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 11
11
</ head >
12
12
13
13
< body >
14
- < mapping-input base-url ="https://matwerk.datamanager.kit.edu:8095/ " maxSize =10 id ="input-component "> </ mapping-input >
14
+ < mapping-input base-url ="https://matwerk.datamanager.kit.edu:8095/ " maxSize =a id ="input-component "> </ mapping-input >
15
15
16
16
</ body >
17
17
Original file line number Diff line number Diff line change @@ -129,6 +129,10 @@ class MappingInputProvider extends HTMLElement {
129
129
const maxSize = this . getAttribute ( ATTRIBUTES [ 1 ] ) ;
130
130
if ( maxSize != null ) {
131
131
this . maxSize = Number . parseInt ( maxSize ) ;
132
+ if ( isNaN ( this . maxSize ) ) {
133
+ console . error ( "Invalid maxSize attribute. Setting value to default." )
134
+ this . maxSize = 5 ;
135
+ }
132
136
}
133
137
134
138
// initialize and connect file uploader
@@ -138,7 +142,7 @@ class MappingInputProvider extends HTMLElement {
138
142
FilePondLib . registerPlugin ( FilePondPluginFileValidateSize ) ;
139
143
options . credits = false ;
140
144
options . maxFiles = 1 ;
141
- options . maxFileSize = `${ maxSize } MB` ;
145
+ options . maxFileSize = `${ this . maxSize } MB` ;
142
146
options . labelIdle = "Drag & Drop your files or <span class=\"filepond--label-action\"> Browse </span><br>" +
143
147
`<span class=\"info-small\">(File size is limited to ${ options . maxFileSize } )</span>` ;
144
148
this . fileChooser = FilePondLib . create ( filepondElement , options ) ;
You can’t perform that action at this time.
0 commit comments