@@ -403,6 +403,7 @@ var modalStyleguide = {
403
403
var el = document . getElementById ( 'sg-pattern-data-' + patternPartial ) ;
404
404
modalStyleguide . collectAndSend ( el , true , false ) ;
405
405
} else {
406
+ modalStyleguide . highlightsHide ( ) ;
406
407
modalStyleguide . close ( patternPartial ) ;
407
408
}
408
409
@@ -474,6 +475,21 @@ var modalStyleguide = {
474
475
}
475
476
} ,
476
477
478
+ /**
479
+ * hide the highlights
480
+ */
481
+ highlightsHide : function ( patternPartial ) {
482
+ var patternPartialSelector = ( patternPartial !== undefined ) ? '#' + patternPartial + " > " : "" ;
483
+ elsToHide = document . querySelectorAll ( patternPartialSelector + '.has-annotation' ) ;
484
+ for ( i = 0 ; i < elsToHide . length ; i ++ ) {
485
+ elsToHide [ i ] . classList . remove ( 'has-annotation' ) ;
486
+ }
487
+ elsToHide = document . querySelectorAll ( patternPartialSelector + '.annotation-tip' ) ;
488
+ for ( i = 0 ; i < elsToHide . length ; i ++ ) {
489
+ elsToHide [ i ] . style . display = 'none' ;
490
+ }
491
+ } ,
492
+
477
493
/**
478
494
* return the pattern info to the top level
479
495
* @param {Object } the content that will be sent to the viewer for rendering
@@ -576,14 +592,7 @@ var modalStyleguide = {
576
592
577
593
} else if ( ( data . event !== undefined ) && ( data . event == 'patternLab.annotationsHighlightHide' ) ) {
578
594
579
- elsToHide = document . querySelectorAll ( '.has-annotation' ) ;
580
- for ( i = 0 ; i < elsToHide . length ; i ++ ) {
581
- elsToHide [ i ] . classList . remove ( 'has-annotation' ) ;
582
- }
583
- elsToHide = document . querySelectorAll ( '.annotation-tip' ) ;
584
- for ( i = 0 ; i < elsToHide . length ; i ++ ) {
585
- elsToHide [ i ] . style . display = 'none' ;
586
- }
595
+ modalStyleguide . highlightsHide ( ) ;
587
596
588
597
} else if ( ( data . event !== undefined ) && ( data . event == 'patternLab.patternModalClose' ) ) {
589
598
0 commit comments