mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-23 00:49:01 +00:00
Merge branch 'master' into Rewrite-MovingTool-to-custom-solution
This commit is contained in:
@ -30,7 +30,7 @@ import { MapNodeToNodeConverter } from '../../cartography/converters/map/map-nod
|
||||
import { SettingsService, Settings } from '../../services/settings.service';
|
||||
import { D3MapComponent } from '../../cartography/components/d3-map/d3-map.component';
|
||||
import { ToolsService } from '../../services/tools.service';
|
||||
import { DrawingContextMenu } from '../../cartography/events/event-source';
|
||||
import { DrawingContextMenu, LinkContextMenu } from '../../cartography/events/event-source';
|
||||
import { MapDrawingToDrawingConverter } from '../../cartography/converters/map/map-drawing-to-drawing-converter';
|
||||
import { SelectionManager } from '../../cartography/managers/selection-manager';
|
||||
import { SelectionTool } from '../../cartography/tools/selection-tool';
|
||||
@ -43,6 +43,7 @@ import { RecentlyOpenedProjectService } from '../../services/recentlyOpenedProje
|
||||
import { MapLink } from '../../cartography/models/map/map-link';
|
||||
import { MapLinkToLinkConverter } from '../../cartography/converters/map/map-link-to-link-converter';
|
||||
import { MovingEventSource } from '../../cartography/events/moving-event-source';
|
||||
import { LinkWidget } from '../../cartography/widgets/link';
|
||||
|
||||
|
||||
@Component({
|
||||
@ -96,6 +97,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
private mapChangeDetectorRef: MapChangeDetectorRef,
|
||||
private nodeWidget: NodeWidget,
|
||||
private drawingsWidget: DrawingsWidget,
|
||||
private linkWidget: LinkWidget,
|
||||
private mapNodeToNode: MapNodeToNodeConverter,
|
||||
private mapDrawingToDrawing: MapDrawingToDrawingConverter,
|
||||
private mapLabelToLabel: MapLabelToLabelConverter,
|
||||
@ -233,6 +235,11 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
this.toolsService.selectionToolActivation(true);
|
||||
}
|
||||
|
||||
const onLinkContextMenu = this.linkWidget.onContextMenu.subscribe((eventLink: LinkContextMenu) => {
|
||||
const link = this.mapLinkToLink.convert(eventLink.link);
|
||||
this.contextMenu.openMenuForListOfElements([], [], [], [link], eventLink.event.pageY, eventLink.event.pageX);
|
||||
});
|
||||
|
||||
const onNodeContextMenu = this.nodeWidget.onContextMenu.subscribe((eventNode: NodeContextMenu) => {
|
||||
const node = this.mapNodeToNode.convert(eventNode.node);
|
||||
this.contextMenu.openMenuForNode(node, eventNode.event.pageY, eventNode.event.pageX);
|
||||
@ -267,6 +274,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
this.contextMenu.openMenuForListOfElements(drawings, nodes, labels, links, event.pageY, event.pageX);
|
||||
});
|
||||
|
||||
this.subscriptions.push(onLinkContextMenu);
|
||||
this.subscriptions.push(onNodeContextMenu);
|
||||
this.subscriptions.push(onDrawingContextMenu);
|
||||
this.subscriptions.push(onContextMenu);
|
||||
|
Reference in New Issue
Block a user