@@ -259,12 +259,12 @@ class Graph extends React.Component {
259
259
}
260
260
261
261
handleClickDiv ( d , i , nodes ) {
262
+ this . props . onFocus ( ) ;
262
263
document . activeElement . blur ( ) ;
263
264
var event = d3_event ;
264
265
event . preventDefault ( ) ;
265
266
event . stopPropagation ( ) ;
266
267
this . unSelectComponents ( ) ;
267
- this . props . onFocus ( ) ;
268
268
}
269
269
270
270
handleKeyDownDocument ( d , i , nodes ) {
@@ -347,6 +347,7 @@ class Graph extends React.Component {
347
347
}
348
348
349
349
handleClickNode ( d , i , nodes ) {
350
+ this . props . onFocus ( ) ;
350
351
document . activeElement . blur ( ) ;
351
352
var event = d3_event ;
352
353
event . preventDefault ( ) ;
@@ -355,10 +356,10 @@ class Graph extends React.Component {
355
356
let extendSelection = event . ctrlKey || event . shiftKey ;
356
357
this . selectComponents ( d3_select ( nodes [ i ] ) , extendSelection ) ;
357
358
}
358
- this . props . onFocus ( ) ;
359
359
}
360
360
361
361
handleDblClickNode ( d , i , nodes ) {
362
+ this . props . onFocus ( ) ;
362
363
document . activeElement . blur ( ) ;
363
364
var event = d3_event ;
364
365
event . preventDefault ( ) ;
@@ -375,10 +376,10 @@ class Graph extends React.Component {
375
376
this . props . onTextChange ( this . dotGraph . dotSrc ) ;
376
377
}
377
378
this . isDrawingEdge = false ;
378
- this . props . onFocus ( ) ;
379
379
}
380
380
381
381
handleRightClickNode ( d , i , nodes ) {
382
+ this . props . onFocus ( ) ;
382
383
document . activeElement . blur ( ) ;
383
384
var event = d3_event ;
384
385
event . preventDefault ( ) ;
@@ -397,39 +398,37 @@ class Graph extends React.Component {
397
398
this . graphviz
398
399
. drawEdge ( x0 , y0 , x0 , y0 , this . latestEdgeAttributes ) ;
399
400
this . isDrawingEdge = true ;
400
- this . props . onFocus ( ) ;
401
401
}
402
402
403
403
handleClickEdge ( d , i , nodes ) {
404
+ this . props . onFocus ( ) ;
404
405
document . activeElement . blur ( ) ;
405
406
var event = d3_event ;
406
407
event . preventDefault ( ) ;
407
408
event . stopPropagation ( ) ;
408
409
let extendSelection = event . ctrlKey || event . shiftKey ;
409
410
this . selectComponents ( d3_select ( nodes [ i ] ) , extendSelection ) ;
410
- this . props . onFocus ( ) ;
411
411
}
412
412
413
413
handleRightClickDiv ( d , i , nodes ) {
414
+ this . props . onFocus ( ) ;
414
415
document . activeElement . blur ( ) ;
415
416
var event = d3_event ;
416
417
event . preventDefault ( ) ;
417
418
event . stopPropagation ( ) ;
418
419
this . unSelectComponents ( ) ;
419
- this . props . onFocus ( ) ;
420
420
}
421
421
422
422
handleMouseDownSvg ( d , i , nodes ) {
423
+ this . props . onFocus ( ) ;
423
424
document . activeElement . blur ( ) ;
424
425
var event = d3_event ;
425
426
if ( event . which !== 1 ) {
426
- this . props . onFocus ( ) ;
427
427
return ;
428
428
}
429
429
event . preventDefault ( ) ;
430
430
event . stopPropagation ( ) ;
431
431
if ( this . selectArea ) {
432
- this . props . onFocus ( ) ;
433
432
return ;
434
433
}
435
434
var [ x0 , y0 ] = d3_mouse ( this . graph0 . node ( ) ) ;
@@ -444,7 +443,6 @@ class Graph extends React.Component {
444
443
. attr ( "stroke" , '#0000dd' )
445
444
. style ( 'stroke-width' , 0.5 )
446
445
. style ( 'fill-opacity' , 0.3 ) ;
447
- this . props . onFocus ( ) ;
448
446
}
449
447
450
448
handleMouseMoveSvg ( d , i , nodes ) {
@@ -467,6 +465,7 @@ class Graph extends React.Component {
467
465
}
468
466
469
467
handleMouseUpSvg ( d , i , nodes ) {
468
+ this . props . onFocus ( ) ;
470
469
document . activeElement . blur ( ) ;
471
470
var event = d3_event ;
472
471
if ( event . which === 1 && this . selectArea ) {
@@ -481,7 +480,6 @@ class Graph extends React.Component {
481
480
let height = Math . abs ( y1 - y0 ) ;
482
481
if ( width === 0 && height === 0 ) {
483
482
this . selectArea = null ;
484
- this . props . onFocus ( ) ;
485
483
return ;
486
484
}
487
485
let components = this . graph0 . selectAll ( '.node,.edge' ) ;
@@ -505,7 +503,6 @@ class Graph extends React.Component {
505
503
this . insertNodeWithLatestAttributes ( x0 , y0 ) ;
506
504
}
507
505
}
508
- this . props . onFocus ( ) ;
509
506
}
510
507
511
508
selectComponents ( components , extendSelection = false ) {
0 commit comments