ngAfterViewInit() { try { let position = window.getComputedStyle(this.el.nativeElement).position; if (this.mustBePosition.indexOf(position) === -1) { console.warn(this.el.nativeElement, 'Must be having position attribute set to ' + this.mustBePosition.join('|')); } } catch (ex) { console.error(ex); } }
constructor( public dialogRef: MatDialogRef<DialogGaugePermission>, @Inject(MAT_DIALOG_DATA) public data: any) { this.selectedGroups = UserGroups.ValueToGroups(this.data.permission); this.extensionGroups = UserGroups.ValueToGroups(this.data.permission, true); }
emitClickEvent($event: Event) { if (this.disabled) { return this.disabled; } this.clicked.emit($event); }
@HostListener('mousedown', ['$event']) onMouseDown(event: MouseEvent) { this.mouseStart = {x: event.pageX, y: event.pageY}; const mouseup$ = Observable.fromEvent(document, 'mouseup'); this._subscription = mouseup$.subscribe(() => this.onMouseup()); const mousemove$ = Observable.fromEvent(document, 'mousemove') .pipe(takeUntil(mouseup$)) .subscribe((e: MouseEvent) => this.onMouseMove(e)); this._subscription.add(mousemove$); }
/** * Set signal value in current frontend signal array * Called from Test and value beckame from backend * @param sig */ setSignalValue(sig: Variable) { // update the signals array value // notify the gui this.onVariableChanged.emit(sig); }
constructor( public dialogRef: MatDialogRef<DialogItemText>, @Inject(MAT_DIALOG_DATA) public data: any) { if (data.editmode > 0) { data.text.name = this.getNextTextId(); } if (data.texts) { this.existtexts = data.texts.filter(t => t.name !== data.text.name); } }
@HostListener('window:resize', ['$event']) onResize(event) { let canvas = this.canvas.nativeElement; let w = canvas.parentNode.clientWidth; let h = canvas.parentNode.clientHeight;// - (canvas.parentNode.clientHeight / 4); if (w < h) h = w; this.canvas.nativeElement.height = h; this.canvas.nativeElement.width = w; this.init(this.type); }
private onClose($event) { if (this.onclose) { this.onclose.emit($event); } // if (this.dialog && this.dialog.view && this.dialog.view.name === viewref) { // this.onCloseDialog(); // } else if (this.cards.find((c) => c.name === viewref)) { // this.onCloseCard(this.cards.find((c) => c.name === viewref)); // } }
onInputChange(value) { const valueChanged = value !== this._value; if (valueChanged) { this._value = value; this.onChange(value); this.change.emit(value); } }
constructor(private authService: AuthService, private projectService: ProjectService, private translateService: TranslateService, private dialogRef: MatDialogRef<LoginComponent>, @Inject(MAT_DIALOG_DATA) private data: any) { }
doTranslation(x: number, y: number) { if (!x || !y) return; this.renderer.setElementStyle(this.el.nativeElement, 'top', (y - this.dy) + 'px'); this.renderer.setElementStyle(this.el.nativeElement, 'left', (x - this.dx) + 'px'); }
constructor( public dialogRef: MatDialogRef<DialogMenuItem>, @Inject(MAT_DIALOG_DATA) public data: any) { this.selectedGroups = UserGroups.ValueToGroups(this.data.permission); }
constructor( private hmiService: HmiService, private projectService: ProjectService, private translateService: TranslateService, public dialogRef: MatDialogRef<DevicePropertyComponent>, @Inject(MAT_DIALOG_DATA) public data: any) { }