浏览代码

removing duplicate code

Kyle Belfort 5 年之前
父节点
当前提交
ef5ece540d
共有 1 个文件被更改,包括 0 次插入25 次删除
  1. 0 25
      nodeEditor/src/diagram/frameNodePort.ts

+ 0 - 25
nodeEditor/src/diagram/frameNodePort.ts

@@ -53,36 +53,11 @@ export class FrameNodePort extends NodePort {
 
     public constructor(portContainer: HTMLElement, public connectionPoint: NodeMaterialConnectionPoint, public node: GraphNode, globalState: GlobalState, isInput: boolean, framePortId: number) {
         super(portContainer, connectionPoint,node, globalState);
-        this._element = portContainer.ownerDocument!.createElement("div");
-        this._element.classList.add("port");
-        portContainer.appendChild(this._element);
-        this._globalState = globalState;
 
         this._portLabel = portContainer.children[0];
         this._isInput = isInput;
         this._framePortId = framePortId;
 
-
-        this._img = portContainer.ownerDocument!.createElement("img");
-        this._element.appendChild(this._img );
-
-        (this._element as any).port = this;
-
-        // Drag support
-        this._element.ondragstart= () => false;
-
-        this._onCandidateLinkMovedObserver = globalState.onCandidateLinkMoved.add(coords => {
-            const rect = this._element.getBoundingClientRect();
-
-            if (!coords || rect.left > coords.x || rect.right < coords.x || rect.top > coords.y || rect.bottom < coords.y) {
-                this._element.classList.remove("selected"); 
-                return;
-            }
-
-            this._element.classList.add("selected"); 
-            this._globalState.onCandidatePortSelectedObservable.notifyObservers(this);
-        });
-
         this._onSelectionChangedObserver = this._globalState.onSelectionChangedObservable.add((selection) => {
             if (selection === this) {
                 this._img.classList.add("selected");