浏览代码

implement minor feedback fixes

Kyle Belfort 5 年之前
父节点
当前提交
3762c45825

文件差异内容过多而无法显示
+ 1241 - 1237
dist/preview release/babylon.module.d.ts


+ 1 - 1
nodeEditor/src/diagram/frameNodePort.ts

@@ -73,7 +73,7 @@ export class FrameNodePort extends NodePort {
             let portLabel = root.ownerDocument!.createElement("div");
             portLabel.classList.add("port-label");
             let portName = connectionPoint.displayName || connectionPoint.name;
-            if (portName === "output") {
+            if (connectionPoint.ownerBlock.isInput) {
                 portName = node.name;
             }
             portLabel.innerHTML = portName;       

+ 2 - 2
nodeEditor/src/diagram/nodePort.ts

@@ -33,7 +33,7 @@ export class NodePort {
 
     public get portName(){
         let portName = this.connectionPoint.displayName || this.connectionPoint.name;
-        if (portName === "output") {
+        if (this.connectionPoint.ownerBlock.isInput) {
             portName = this.node.name;
         }
         return portName
@@ -51,7 +51,7 @@ export class NodePort {
     }
 
     public get exposedOnFrame() {
-        return this._exposedOnFrame || this.connectionPoint.isConnectedToAnything;
+        return this.connectionPoint.isConnectedToAnything || this._exposedOnFrame;
     }
 
     public set exposedOnFrame(value: boolean) {

+ 2 - 9
nodeEditor/src/sharedComponents/checkBoxLineComponent.tsx

@@ -70,13 +70,6 @@ export class CheckBoxLineComponent extends React.Component<ICheckBoxLineComponen
         this.setState({ isSelected: !this.state.isSelected });
     }
 
-    getDisabled() {
-        if (this.props.disabled) {
-            return this.props.disabled;
-        }
-        else return false;
-    }
-
     render() {
         return (
             <div className="checkBoxLine">
@@ -84,8 +77,8 @@ export class CheckBoxLineComponent extends React.Component<ICheckBoxLineComponen
                     {this.props.label}
                 </div>
                 <div className="checkBox">
-                    <input type="checkbox" id={"checkbox" + this._uniqueId} className="cbx hidden" checked={this.state.isSelected} onChange={() => this.onChange()} disabled={this.getDisabled()}/>
-                    <label htmlFor={"checkbox" + this._uniqueId} className={`lbl${this.getDisabled() ? ' disabled' : ''}`}></label>
+                    <input type="checkbox" id={"checkbox" + this._uniqueId} className="cbx hidden" checked={this.state.isSelected} onChange={() => this.onChange()} disabled={!!this.props.disabled}/>
+                    <label htmlFor={"checkbox" + this._uniqueId} className={`lbl${!!this.props.disabled ? ' disabled' : ''}`}></label>
                 </div>
             </div>
         );