mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-20 15:40:29 +00:00
Merge branch 'master' into Fit-in-view-option
This commit is contained in:
@ -84,6 +84,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
public isInterfaceLabelVisible: boolean = false;
|
||||
public notificationsVisibility: boolean = false;
|
||||
public layersVisibility: boolean = false;
|
||||
public gridVisibility: boolean = false;
|
||||
|
||||
tools = {
|
||||
selection: true,
|
||||
@ -240,6 +241,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.notificationsVisibility = localStorage.getItem('notificationsVisibility') === 'true' ? true : false;
|
||||
this.layersVisibility = localStorage.getItem('layersVisibility') === 'true' ? true : false;
|
||||
this.gridVisibility = localStorage.getItem('gridVisibility') === 'true' ? true : false;
|
||||
this.addKeyboardListeners();
|
||||
}
|
||||
|
||||
@ -617,6 +619,20 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
this.mapChild.applyMapSettingsChanges();
|
||||
}
|
||||
|
||||
public toggleGrid(visible: boolean) {
|
||||
this.gridVisibility = visible;
|
||||
if (this.gridVisibility) {
|
||||
localStorage.setItem('gridVisibility', 'true');
|
||||
} else {
|
||||
localStorage.removeItem('gridVisibility');
|
||||
}
|
||||
this.mapChild.gridVisibility = this.gridVisibility ? 1 : 0;
|
||||
}
|
||||
|
||||
public toggleSnapToGrid(enabled: boolean) {
|
||||
this.project.snap_to_grid = enabled;
|
||||
}
|
||||
|
||||
private showMessage(msg) {
|
||||
if (this.notificationsVisibility) {
|
||||
if (msg.type === 'error') this.toasterService.error(msg.message);
|
||||
|
Reference in New Issue
Block a user