@@ -414,6 +414,7 @@ function beginCapture(e) {
414
414
MugShot . selecting = true ;
415
415
MugShot . img . addEventListener ( 'mousemove' , updateCapture ) ;
416
416
MugShot . img . addEventListener ( 'mouseup' , haltCapture ) ;
417
+
417
418
// left top height width
418
419
var frame = {
419
420
'lft' : e . pageX - MugShot . offset . left ,
@@ -424,13 +425,14 @@ function beginCapture(e) {
424
425
425
426
MugShot . createBoundingBox ( frame ) ;
426
427
427
- // // Hide all the frames while we select the new one. Keeps them from interfering.
428
- // MugShot.mugs.forEach(mug => {
429
- // mug. frame.el.style = ' hidden' ;
430
- // mug. name.el.style = ' hidden' ;
431
- // });
428
+ // Hide all the frames while we select the new one. Keeps them from interfering.
429
+ for ( let index = 0 ; index < MugShot . mugs . length - 1 ; index ++ ) {
430
+ MugShot . mugs [ index ] . frame . el . classList . toggle ( 'mugshot- hidden-while-selecting' ) ;
431
+ MugShot . mugs [ index ] . name . el . classList . toggle ( 'mugshot- hidden-while-selecting' ) ;
432
+ }
432
433
433
434
MugShot . mugs [ MugShot . cfi ] . frame . el . classList . toggle ( 'mugshot-active' ) ;
435
+
434
436
MugShot . toggleSubmitBtn ( 'on' ) ;
435
437
}
436
438
}
@@ -448,6 +450,13 @@ function haltCapture(e) {
448
450
MugShot . img . removeEventListener ( 'mouseup' , haltCapture , false ) ;
449
451
MugShot . mugs [ MugShot . cfi ] . frame . el . ondblclick = updateBoundingBox ;
450
452
MugShot . mugs [ MugShot . cfi ] . frame . el . classList . toggle ( 'mugshot-mousetrap' ) ;
453
+
454
+ // Done capturing so re-show the other mugshot frames
455
+ for ( let index = 0 ; index < MugShot . mugs . length - 1 ; index ++ ) {
456
+ MugShot . mugs [ index ] . frame . el . classList . toggle ( 'mugshot-hidden-while-selecting' ) ;
457
+ MugShot . mugs [ index ] . name . el . classList . toggle ( 'mugshot-hidden-while-selecting' ) ;
458
+ }
459
+
451
460
var pos = MugShot . setBoundingBoxPosition ( e . pageX - MugShot . offset . left , e . pageY - MugShot . offset . top ) ;
452
461
MugShot . mugs [ MugShot . cfi ] . frame . left = pos [ 0 ] ;
453
462
MugShot . mugs [ MugShot . cfi ] . frame . top = pos [ 1 ] ;
0 commit comments