implement layer compare slider
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma
2022-09-27 19:58:08 +02:00
parent 15cc2c33f1
commit 7502bc54d1
11 changed files with 192 additions and 31 deletions

View File

@@ -1,4 +1,4 @@
import { Component, Input,ViewChild,ElementRef,OnChanges,SimpleChanges,HostListener,ChangeDetectorRef } from '@angular/core';
import { Component, Input,Output,ViewChild,EventEmitter, ElementRef,OnChanges,SimpleChanges,HostListener,ChangeDetectorRef } from '@angular/core';
@Component({
selector: 'fm-side-panel',
@@ -12,7 +12,8 @@ export class SidePanelComponent implements OnChanges {
@Input() public collapsed: boolean;
@Input() public collapsable: boolean;
@Input() public resizeable: boolean = false;
@Input() public left: boolean = false;
@Input() public left: boolean = false;
@Output() onResize: EventEmitter<number> = new EventEmitter<number>();
@ViewChild("resizeGrip") elementView: ElementRef;
public mobile:boolean = true;
private parentHeight:number = 0;
@@ -35,6 +36,7 @@ export class SidePanelComponent implements OnChanges {
setTop() {
this.mobile = this.left?false: this.checkMobile();
this.resizeTop = this.mobile?50:0;
this.onResize.emit(this.resizeTop);
this.top = (this.visible?this.resizeTop: (this.mobile? 100:0)) + "%";
}
@@ -71,6 +73,7 @@ export class SidePanelComponent implements OnChanges {
clientY=(event as DragEvent).clientY;
}
this.resizeTop = Math.min(98, Math.max(0, clientY / (this.parentHeight / 100)));
this.onResize.emit(this.resizeTop);
this.top = (this.visible? this.resizeTop:(this.mobile? 100:0)) + "%";
}
@@ -81,7 +84,7 @@ export class SidePanelComponent implements OnChanges {
}
@HostListener('window:resize', ['$event'])
onResize(event) {
handleResize(event) {
this.setTop();
}
}