File tree Expand file tree Collapse file tree 1 file changed +0
-17
lines changed Expand file tree Collapse file tree 1 file changed +0
-17
lines changed Original file line number Diff line number Diff line change @@ -124,28 +124,11 @@ export function csvButton (dom, tracker) {
124124 div . addEventListener ( 'copy' , event => {
125125 // alert ('Copy caught');
126126 const csv = csvText ( store , tracker ) ;
127- const csv1 = TestCSVstring
128127 event . clipboardData . setData ( "text/plain" , csv ) ;
129128 event . clipboardData . setData ( "text/csv" , csv ) ;
130129 alert ( 'Copy data: ' + csv )
131130 event . preventDefault ( ) ;
132131 } )
133-
134- var copyEvent = new ClipboardEvent ( 'copy' ) ;
135- if ( ! copyEvent ) {
136- alert ( 'CSV: Copy event failed.' )
137- } else if ( ! copyEvent . clipboardData ) {
138- alert ( 'CSV: Now do a copy operation to copy as CSV data' )
139- } else {
140- copyEvent . clipboardData . items . add ( csv , 'text/csv' ) ;
141- copyEvent . clipboardData . items . add ( csv , 'text/plain' ) ;
142- dom . dispatchEvent ( copyEvent ) ;
143- alert ( 'Copy dispatched.' )
144- // https://developer.mozilla.org/en-US/docs/Web/API/Element/copy_event
145- // t's possible to construct and dispatch a synthetic copy event,
146- // but this will not affect the system clipboard.
147- }
148- event . preventDefault ( )
149132 } )
150133
151134 wrapper . appendChild ( button )
You can’t perform that action at this time.
0 commit comments