Resolve global lock/unlock functionality handled by locally

This commit is contained in:
Rajnikant Lodhi 2022-08-29 16:55:22 +05:30
parent fcfcb7566d
commit 0ed26e3621
3 changed files with 21 additions and 2 deletions

View File

@ -52,8 +52,8 @@ export class DraggableSelectionComponent implements OnInit, OnDestroy {
this.mapSettingsSubscription = this.mapSettingsService.isMapLocked.subscribe((value) => {
this.isMapLocked = value;
console.log('locl value---',this.isMapLocked)
});
this.start = merge(
this.nodesWidget.draggable.start,
this.drawingsWidget.draggable.start,

View File

@ -160,8 +160,8 @@ export class ProjectMapMenuComponent implements OnInit, OnDestroy {
public changeLockValue() {
this.isLocked = !this.isLocked;
this.mapSettingsService.changeMapLockValue(this.isLocked);
}
}
public uploadImageFile(event) {
this.readImageFile(event.target);
}

View File

@ -139,6 +139,8 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
@ViewChild('topologySummaryContainer', { read: ViewContainerRef }) topologySummaryContainer: ViewContainerRef;
private projectMapSubscription: Subscription = new Subscription();
private mapSettingsSubscription: Subscription;
private isMapLocked: boolean = false;
constructor(
private route: ActivatedRoute,
@ -217,6 +219,23 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
? (this.isLightThemeEnabled = true)
: (this.isLightThemeEnabled = false);
});
this.mapSettingsSubscription = this.mapSettingsService.isMapLocked.subscribe((value) => {
this.isMapLocked = value;
this.all_lock_Nodes()
console.log('lock value---',this.isMapLocked)
});
}
all_lock_Nodes(){
this.nodes.forEach((node) => {
node.locked = this.isMapLocked;
this.nodesDataSource.update(node);
});
this.drawings.forEach((drawing) => {
drawing.locked = !drawing.locked;
this.drawingsDataSource.update(drawing);
});
}
getSettings() {