implement layer compare slider
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user