File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 display : block;
99 text-align : center;
1010 border : 4px dashed lightgrey;
11- height : 200px ;
12- line-height : 200px ;
11+ padding : 100px ;
1312 font-family : sans-serif;
14- font-size : 1.5em ;
1513 }
1614 file-attachment [hover ] {
1715 border-color : gold;
1816 }
17+ input {
18+ font-size : inherit;
19+ }
1920 </ style >
2021</ head >
2122< body >
22- < file-attachment >
23- Drop files here
23+ < file-attachment input ="file ">
24+ Drop files here or
25+ < input type ="file " id ="file " multiple >
26+ < pre > </ pre >
2427 </ file-attachment >
2528
2629 <!-- GitHub Pages development script, uncomment when running example locally and comment out the production one -->
3033 < script type ="module " src ="https://unpkg.com/@github/file-attachment-element@latest/dist/index.js "> </ script >
3134
3235 < script >
33- const attach = document . querySelector ( 'file-attachment ' )
34- attach . addEventListener ( 'file-attachment-accepted' , function ( event ) {
36+ const pre = document . querySelector ( 'pre ' )
37+ document . addEventListener ( 'file-attachment-accepted' , function ( event ) {
3538 const { attachments} = event . detail
36- attach . textContent = attachments . map ( a => a . file . name ) . join ( ', ' )
39+ pre . textContent = attachments . map ( a => a . file . name ) . join ( '\n ' )
3740 } )
3841 </ script >
3942</ body >
You can’t perform that action at this time.
0 commit comments