mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-14 13:08:07 +00:00
Disable selectiontool when in readonly mode
This commit is contained in:
@ -195,6 +195,9 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
setUpMapCallbacks(project: Project) {
|
||||
if (this.project.readonly) {
|
||||
this.mapChild.graphLayout.getSelectionTool().deactivate();
|
||||
}
|
||||
this.mapChild.graphLayout.getNodesWidget().setDraggingEnabled(!this.project.readonly);
|
||||
|
||||
this.mapChild.graphLayout.getNodesWidget().setOnContextMenuCallback((event: any, node: Node) => {
|
||||
@ -274,13 +277,17 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
public toggleMovingMode() {
|
||||
this.movingMode = !this.movingMode;
|
||||
if (this.movingMode) {
|
||||
if (!this.project.readonly) {
|
||||
this.mapChild.graphLayout.getSelectionTool().deactivate();
|
||||
}
|
||||
this.mapChild.graphLayout.getMovingTool().activate();
|
||||
} else {
|
||||
this.mapChild.graphLayout.getMovingTool().deactivate();
|
||||
if (!this.project.readonly) {
|
||||
this.mapChild.graphLayout.getSelectionTool().activate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public onChooseInterface(event) {
|
||||
const node: Node = event.node;
|
||||
|
Reference in New Issue
Block a user