mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-01-31 00:23:57 +00:00
Remove unused code
This commit is contained in:
parent
8a8fabdee7
commit
0cc7b62526
@ -40,7 +40,6 @@ import { AppComponent } from './app.component';
|
||||
import { MapComponent } from './cartography/map/map.component';
|
||||
import { CreateSnapshotDialogComponent, ProjectMapComponent } from './project-map/project-map.component';
|
||||
import { ServersComponent, AddServerDialogComponent } from './servers/servers.component';
|
||||
import { ContextMenuComponent } from './shared/context-menu/context-menu.component';
|
||||
import { NodeContextMenuComponent } from './shared/node-context-menu/node-context-menu.component';
|
||||
|
||||
|
||||
@ -55,7 +54,6 @@ import { NodeContextMenuComponent } from './shared/node-context-menu/node-contex
|
||||
ProjectsComponent,
|
||||
DefaultLayoutComponent,
|
||||
ProgressDialogComponent,
|
||||
ContextMenuComponent,
|
||||
NodeContextMenuComponent,
|
||||
],
|
||||
imports: [
|
||||
|
@ -1,12 +1,7 @@
|
||||
import {Widget} from "./widget";
|
||||
import {Node} from "../models/node.model";
|
||||
import {SVGSelection} from "../../../map/models/types";
|
||||
import { Widget } from "./widget";
|
||||
import { Node } from "../models/node.model";
|
||||
import { SVGSelection } from "../../../map/models/types";
|
||||
import { event } from "d3-selection";
|
||||
import { D3} from "d3-ng2-service";
|
||||
|
||||
import {D3DragEvent} from "d3-drag";
|
||||
import {select} from "d3-selection";
|
||||
import {isUndefined} from "util";
|
||||
|
||||
export interface NodeOnContextMenuListener {
|
||||
onContextMenu(): void;
|
||||
@ -53,10 +48,6 @@ export class NodesWidget implements Widget {
|
||||
.attr('width', (n: Node) => n.width)
|
||||
.attr('height', (n: Node) => n.height)
|
||||
.on("contextmenu", function (n: Node, i: number) {
|
||||
// if (self.onContextMenuListener !== ) {
|
||||
// self.onContextMenuListener.onContextMenu();
|
||||
// }
|
||||
console.log(event);
|
||||
event.preventDefault();
|
||||
if (self.onContextMenuCallback !== null) {
|
||||
self.onContextMenuCallback(event);
|
||||
|
@ -1,6 +0,0 @@
|
||||
<span [matMenuTriggerFor]="contextMenu"></span>
|
||||
<button mat-button (contextmenu)="openContextMenu($event)">Context Menu</button>
|
||||
<mat-menu #contextMenu="matMenu">
|
||||
<button md-menu-item>Item 1</button>
|
||||
<button md-menu-item>Item 2</button>
|
||||
</mat-menu>
|
@ -1,25 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ContextMenuComponent } from './context-menu.component';
|
||||
|
||||
describe('ContextMenuComponent', () => {
|
||||
let component: ContextMenuComponent;
|
||||
let fixture: ComponentFixture<ContextMenuComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ContextMenuComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ContextMenuComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,24 +0,0 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { MatMenuTrigger } from '@angular/material';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-context-menu',
|
||||
templateUrl: './context-menu.component.html',
|
||||
styleUrls: ['./context-menu.component.scss']
|
||||
})
|
||||
export class ContextMenuComponent implements OnInit {
|
||||
@ViewChild(MatMenuTrigger) contextMenu: MatMenuTrigger;
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
openContextMenu(event) {
|
||||
event.preventDefault();
|
||||
this.contextMenu.openMenu();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user