File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1111 ],
1212 "require" : {
1313 "php" : " ^8.0" ,
14- "maximebf/debugbar" : " ~1.22.4 " ,
14+ "maximebf/debugbar" : " ~1.23.0 " ,
1515 "illuminate/routing" : " ^9|^10|^11" ,
1616 "illuminate/session" : " ^9|^10|^11" ,
1717 "illuminate/support" : " ^9|^10|^11" ,
Original file line number Diff line number Diff line change 2828 window . getSelection ( ) . addRange ( range ) ;
2929 }
3030
31+ var isCopied = false ;
3132 try {
32- document . execCommand ( 'copy' ) ;
33+ isCopied = document . execCommand ( 'copy' ) ;
3334 alert ( 'Query copied to the clipboard' ) ;
3435 } catch ( err ) {
3536 console . log ( 'Oops, unable to copy' ) ;
3637 }
3738
3839 window . getSelection ( ) . removeAllRanges ( ) ;
40+
41+ return isCopied ;
3942 } ,
4043
4144 explainMysql : function ( $element , statement , rows ) {
235238 $ ( '<span title="Copy to clipboard" />' )
236239 . addClass ( csscls ( 'copy-clipboard' ) )
237240 . css ( 'cursor' , 'pointer' )
241+ . html ( "​" )
238242 . on ( 'click' , ( event ) => {
239243 event . stopPropagation ( ) ;
240- this . copyToClipboard ( $code . get ( 0 ) ) ;
244+ if ( this . copyToClipboard ( $code . get ( 0 ) ) ) {
245+ $ ( event . target ) . addClass ( csscls ( 'copy-clipboard-check' ) ) ;
246+ setTimeout ( function ( ) {
247+ $ ( event . target ) . removeClass ( csscls ( 'copy-clipboard-check' ) ) ;
248+ } , 2000 )
249+ }
241250 } )
242251 ) ;
243252 }
You can’t perform that action at this time.
0 commit comments