File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 10
10
data-cargo-features ="webc "
11
11
/>
12
12
< script >
13
+ const $ = document . querySelector . bind ( document ) ;
14
+ const $$ = document . querySelectorAll . bind ( document ) ;
15
+
13
16
function fileLoaded ( array ) {
14
17
const container = document . createElement ( "preview-area" ) ;
15
18
let images = window . wasmBindings . previews ( array ) ;
16
19
images . forEach ( function ( src ) {
17
20
container . appendChild ( new PreviewItem ( src ) ) ;
18
21
} ) ;
19
- document . querySelector ( 'preview-wrapper' ) . appendChild ( container )
22
+ $ ( 'preview-wrapper' ) . appendChild ( container )
20
23
}
21
24
22
25
document . addEventListener ( "DOMContentLoaded" , ( ) => {
23
- document . getElementById ( ' file-input') . addEventListener ( "file-reader-input:loaded" ,
26
+ $ ( '# file-input') . addEventListener ( "file-reader-input:loaded" ,
24
27
e => fileLoaded ( e . detail )
25
28
) ;
26
29
} ) ;
You can’t perform that action at this time.
0 commit comments