@@ -206,6 +206,7 @@ export class HomeComponent implements OnInit, AfterViewInit, OnDestroy {
206
206
this . changeDetector . detectChanges ( ) ;
207
207
this . setBackground ( ) ;
208
208
if ( this . homeView . type !== this . cardViewType ) {
209
+ this . checkZoom ( ) ;
209
210
this . fuxaview . hmi . layout = this . hmi . layout ;
210
211
this . fuxaview . loadHmi ( this . homeView ) ;
211
212
} else if ( this . cardsview ) {
@@ -403,18 +404,7 @@ export class HomeComponent implements OnInit, AfterViewInit, OnDestroy {
403
404
this . changeDetector . detectChanges ( ) ;
404
405
this . loadHeaderItems ( ) ;
405
406
}
406
- if ( this . hmi . layout . zoom && ZoomModeType [ this . hmi . layout . zoom ] === ZoomModeType . enabled ) {
407
- setTimeout ( ( ) => {
408
- let element : HTMLElement = document . querySelector ( '#home' ) ;
409
- if ( element && panzoom ) {
410
- panzoom ( element , {
411
- bounds : true ,
412
- boundsPadding : 0.05 ,
413
- } ) ;
414
- }
415
- this . container . nativeElement . style . overflow = 'hidden' ;
416
- } , 1000 ) ;
417
- }
407
+ this . checkZoom ( ) ;
418
408
}
419
409
}
420
410
if ( this . homeView && this . fuxaview ) {
@@ -428,6 +418,21 @@ export class HomeComponent implements OnInit, AfterViewInit, OnDestroy {
428
418
}
429
419
}
430
420
421
+ private checkZoom ( ) {
422
+ if ( this . hmi . layout ?. zoom && ZoomModeType [ this . hmi . layout . zoom ] === ZoomModeType . enabled ) {
423
+ setTimeout ( ( ) => {
424
+ let element : HTMLElement = document . querySelector ( '#home' ) ;
425
+ if ( element && panzoom ) {
426
+ panzoom ( element , {
427
+ bounds : true ,
428
+ boundsPadding : 0.05 ,
429
+ } ) ;
430
+ }
431
+ this . container . nativeElement . style . overflow = 'hidden' ;
432
+ } , 1000 ) ;
433
+ }
434
+ }
435
+
431
436
private loadHeaderItems ( ) {
432
437
this . headerItemsMap . clear ( ) ;
433
438
if ( ! this . showNavigation ) {
0 commit comments