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) {
|
setUpMapCallbacks(project: Project) {
|
||||||
|
if (this.project.readonly) {
|
||||||
|
this.mapChild.graphLayout.getSelectionTool().deactivate();
|
||||||
|
}
|
||||||
this.mapChild.graphLayout.getNodesWidget().setDraggingEnabled(!this.project.readonly);
|
this.mapChild.graphLayout.getNodesWidget().setDraggingEnabled(!this.project.readonly);
|
||||||
|
|
||||||
this.mapChild.graphLayout.getNodesWidget().setOnContextMenuCallback((event: any, node: Node) => {
|
this.mapChild.graphLayout.getNodesWidget().setOnContextMenuCallback((event: any, node: Node) => {
|
||||||
@ -274,11 +277,15 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
|||||||
public toggleMovingMode() {
|
public toggleMovingMode() {
|
||||||
this.movingMode = !this.movingMode;
|
this.movingMode = !this.movingMode;
|
||||||
if (this.movingMode) {
|
if (this.movingMode) {
|
||||||
this.mapChild.graphLayout.getSelectionTool().deactivate();
|
if (!this.project.readonly) {
|
||||||
|
this.mapChild.graphLayout.getSelectionTool().deactivate();
|
||||||
|
}
|
||||||
this.mapChild.graphLayout.getMovingTool().activate();
|
this.mapChild.graphLayout.getMovingTool().activate();
|
||||||
} else {
|
} else {
|
||||||
this.mapChild.graphLayout.getMovingTool().deactivate();
|
this.mapChild.graphLayout.getMovingTool().deactivate();
|
||||||
this.mapChild.graphLayout.getSelectionTool().activate();
|
if (!this.project.readonly) {
|
||||||
|
this.mapChild.graphLayout.getSelectionTool().activate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user