File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -1236,12 +1236,19 @@ function web_editor(config) {
12361236 // Connect to board
12371237 return window . daplink . connect ( ) ;
12381238 } )
1239- . then ( ( ) => {
1240- console . log ( " Connection Complete" ) ;
1239+ . then ( function ( ) {
1240+ console . log ( ' Connection Complete' ) ;
12411241 } ) ;
12421242 }
12431243
12441244 return p . then ( function ( ) {
1245+ // Dispatch event for listeners
1246+ document . dispatchEvent ( new CustomEvent ( 'webusb' , { 'detail' : {
1247+ 'flash-type' : 'webusb' ,
1248+ 'event-type' : 'info' ,
1249+ 'message' : 'connected'
1250+ } } ) ) ;
1251+
12451252 // Change button to disconnect
12461253 $ ( "#command-connect" ) . hide ( ) ;
12471254 $ ( "#command-disconnect" ) . show ( ) ;
@@ -1380,8 +1387,8 @@ function web_editor(config) {
13801387 }
13811388 }
13821389
1383- p . finally ( ( ) => {
1384- console . log ( " Disconnection Complete" ) ;
1390+ p . finally ( function ( ) {
1391+ console . log ( ' Disconnection Complete' ) ;
13851392 } ) ;
13861393
13871394 return p ;
You can’t perform that action at this time.
0 commit comments