Skip to content

Commit 5d370ac

Browse files
committed
fix: View zoom in manually mode #831
1 parent 7676462 commit 5d370ac

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

.github/workflows/docker_image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Publish DockerHub image
1+
name: Build and Publish DockerHub image latest
22

33
env:
44
app: fuxa

client/src/app/home/home.component.ts

+17-12
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ export class HomeComponent implements OnInit, AfterViewInit, OnDestroy {
206206
this.changeDetector.detectChanges();
207207
this.setBackground();
208208
if (this.homeView.type !== this.cardViewType) {
209+
this.checkZoom();
209210
this.fuxaview.hmi.layout = this.hmi.layout;
210211
this.fuxaview.loadHmi(this.homeView);
211212
} else if (this.cardsview) {
@@ -403,18 +404,7 @@ export class HomeComponent implements OnInit, AfterViewInit, OnDestroy {
403404
this.changeDetector.detectChanges();
404405
this.loadHeaderItems();
405406
}
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();
418408
}
419409
}
420410
if (this.homeView && this.fuxaview) {
@@ -428,6 +418,21 @@ export class HomeComponent implements OnInit, AfterViewInit, OnDestroy {
428418
}
429419
}
430420

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+
431436
private loadHeaderItems() {
432437
this.headerItemsMap.clear();
433438
if (!this.showNavigation) {

0 commit comments

Comments
 (0)