@@ -94,8 +94,12 @@ export class VerticalNavigationComponent implements OnChanges, OnInit, AfterView
9494 onRefreshed : ReplaySubject < boolean > = new ReplaySubject < boolean > ( 1 )
9595 private _animationsEnabled = false
9696 private _asideOverlay : HTMLElement
97- private readonly _handleAsideOverlayClick = ( ) => { this . closeAside ( ) }
98- private readonly _handleOverlayClick = ( ) => { this . close ( ) }
97+ private readonly _handleAsideOverlayClick = ( ) => {
98+ this . closeAside ( )
99+ }
100+ private readonly _handleOverlayClick = ( ) => {
101+ this . close ( )
102+ }
99103 private _hovered = false
100104 private _mutationObserver : MutationObserver
101105 private _overlay : HTMLElement
@@ -134,8 +138,7 @@ export class VerticalNavigationComponent implements OnChanges, OnInit, AfterView
134138 /**
135139 * Setter for seedScrollbarDirectives
136140 */
137- @ViewChildren ( ScrollbarDirective )
138- set seedScrollbarDirectives ( seedScrollbarDirectives : QueryList < ScrollbarDirective > ) {
141+ @ViewChildren ( ScrollbarDirective ) set seedScrollbarDirectives ( seedScrollbarDirectives : QueryList < ScrollbarDirective > ) {
139142 // Store the directives
140143 this . _scrollbarDirectives = seedScrollbarDirectives
141144
@@ -159,31 +162,17 @@ export class VerticalNavigationComponent implements OnChanges, OnInit, AfterView
159162 } )
160163 }
161164
162- /**
163- * On mouseenter
164- *
165- * @private
166- */
167- @HostListener ( 'mouseenter' )
168- private _onMouseenter ( ) : void {
169- // Enable the animations
165+ @HostListener ( 'mouseenter' ) private _onMouseenter ( ) : void {
170166 this . _enableAnimations ( )
171167
172- // Set the hovered
168+ // Set hovered state
173169 this . _hovered = true
174170 }
175171
176- /**
177- * On mouseleave
178- *
179- * @private
180- */
181- @HostListener ( 'mouseleave' )
182- private _onMouseleave ( ) : void {
183- // Enable the animations
172+ @HostListener ( 'mouseleave' ) private _onMouseleave ( ) : void {
184173 this . _enableAnimations ( )
185174
186- // Set the hovered
175+ // Set hovered state
187176 this . _hovered = false
188177 }
189178
@@ -304,7 +293,7 @@ export class VerticalNavigationComponent implements OnChanges, OnInit, AfterView
304293 // This fixes the problem by reading the 'top' value from the html element and adding it as a
305294 // 'marginTop' to the navigation itself.
306295 this . _mutationObserver = new MutationObserver ( ( mutations ) => {
307- mutations . forEach ( ( mutation ) => {
296+ for ( const mutation of mutations ) {
308297 const mutationTarget = mutation . target as HTMLElement
309298 if ( mutation . attributeName === 'class' ) {
310299 if ( mutationTarget . classList . contains ( 'cdk-global-scrollblock' ) ) {
@@ -314,7 +303,7 @@ export class VerticalNavigationComponent implements OnChanges, OnInit, AfterView
314303 this . _renderer2 . setStyle ( this . _elementRef . nativeElement , 'margin-top' , null )
315304 }
316305 }
317- } )
306+ }
318307 } )
319308 this . _mutationObserver . observe ( this . _document . documentElement , {
320309 attributes : true ,
@@ -339,15 +328,15 @@ export class VerticalNavigationComponent implements OnChanges, OnInit, AfterView
339328 }
340329 } else {
341330 // Go through all the scrollbar directives
342- this . _scrollbarDirectives . forEach ( ( seedScrollbarDirective ) => {
331+ for ( const seedScrollbarDirective of this . _scrollbarDirectives ) {
343332 // Skip if not enabled
344333 if ( ! seedScrollbarDirective . isEnabled ( ) ) {
345334 return
346335 }
347336
348337 // Scroll to the active element
349338 seedScrollbarDirective . scrollToElement ( '.seed-vertical-navigation-item-active' , - 120 , true )
350- } )
339+ }
351340 }
352341 } )
353342 }
@@ -468,33 +457,11 @@ export class VerticalNavigationComponent implements OnChanges, OnInit, AfterView
468457 }
469458 }
470459
471- /**
472- * Enable the animations
473- *
474- * @private
475- */
476460 private _enableAnimations ( ) : void {
477- // Return if the animations are already enabled
478- if ( this . _animationsEnabled ) {
479- return
480- }
481-
482- // Enable the animations
483461 this . _animationsEnabled = true
484462 }
485463
486- /**
487- * Disable the animations
488- *
489- * @private
490- */
491464 private _disableAnimations ( ) : void {
492- // Return if the animations are already disabled
493- if ( ! this . _animationsEnabled ) {
494- return
495- }
496-
497- // Disable the animations
498465 this . _animationsEnabled = false
499466 }
500467
0 commit comments