|
|
@ -47,9 +47,7 @@ import {I18nService} from "core-app/modules/common/i18n/i18n.service"; |
|
|
|
}) |
|
|
|
}) |
|
|
|
export class IFCViewerComponent implements OnInit, OnDestroy { |
|
|
|
export class IFCViewerComponent implements OnInit, OnDestroy { |
|
|
|
private viewerUI:any; |
|
|
|
private viewerUI:any; |
|
|
|
|
|
|
|
modelCount:number; |
|
|
|
modelCount = this.ifcData.models.length; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
canManage = this.ifcData.allowed('manage_ifc_models'); |
|
|
|
canManage = this.ifcData.allowed('manage_ifc_models'); |
|
|
|
|
|
|
|
|
|
|
|
text = { |
|
|
|
text = { |
|
|
@ -70,6 +68,8 @@ export class IFCViewerComponent implements OnInit, OnDestroy { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ngOnInit():void { |
|
|
|
ngOnInit():void { |
|
|
|
|
|
|
|
this.modelCount = this.ifcData.models.length; |
|
|
|
|
|
|
|
|
|
|
|
if (this.modelCount === 0) { |
|
|
|
if (this.modelCount === 0) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -94,13 +94,15 @@ export class IFCViewerComponent implements OnInit, OnDestroy { |
|
|
|
|
|
|
|
|
|
|
|
@HostListener('mousedown') |
|
|
|
@HostListener('mousedown') |
|
|
|
enableKeyBoard() { |
|
|
|
enableKeyBoard() { |
|
|
|
this.keyboardEnabled = true; |
|
|
|
if (this.modelCount) { |
|
|
|
this.ifcViewer.setKeyboardEnabled(true); |
|
|
|
this.keyboardEnabled = true; |
|
|
|
|
|
|
|
this.ifcViewer.setKeyboardEnabled(true); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@HostListener('window:mousedown', ['$event.target']) |
|
|
|
@HostListener('window:mousedown', ['$event.target']) |
|
|
|
disableKeyboard(target:Element) { |
|
|
|
disableKeyboard(target:Element) { |
|
|
|
if (!this.outerContainer.nativeElement!.contains(target)) { |
|
|
|
if (this.modelCount && !this.outerContainer.nativeElement!.contains(target)) { |
|
|
|
this.keyboardEnabled = false; |
|
|
|
this.keyboardEnabled = false; |
|
|
|
this.ifcViewer.setKeyboardEnabled(false); |
|
|
|
this.ifcViewer.setKeyboardEnabled(false); |
|
|
|
} |
|
|
|
} |
|
|
|