소스 검색

fix for properties gui

Nikolay Suslov 5 년 전
부모
커밋
85f0e2ad24
1개의 변경된 파일16개의 추가작업 그리고 11개의 파일을 삭제
  1. 16 11
      public/vwf/view/editor-new.js

+ 16 - 11
public/vwf/view/editor-new.js

@@ -3781,6 +3781,14 @@ define([
             var property = node.properties[propertyName] = createProperty.call(this, node, propertyName, propertyValue);
             var property = node.properties[propertyName] = createProperty.call(this, node, propertyName, propertyValue);
 
 
             node.properties.push(property);
             node.properties.push(property);
+
+            let nodeCell = document.querySelector("#currentNode");
+            if (nodeCell !== null) {
+                if (nodeCell._currentNode === nodeID) {
+                    nodeCell._getNodeProperties();
+                }
+            }
+
         },
         },
 
 
         deletedNode: function (nodeID) {
         deletedNode: function (nodeID) {
@@ -3891,29 +3899,26 @@ define([
             let nodeCell = document.querySelector('#currentNode');
             let nodeCell = document.querySelector('#currentNode');
 
 
             if (nodeCell !== null) {
             if (nodeCell !== null) {
+
                 if (nodeCell._currentNode == nodeID && propertyName == 'edit') {
                 if (nodeCell._currentNode == nodeID && propertyName == 'edit') {
-                    let editCheckBox = document.querySelector("#currentNode #editnode");
 
 
+                    let gizmoChild = node.children.filter(el=>el.ID.includes('gizmo'));
+                    if (gizmoChild.length > 0) {
+
+                    let editCheckBox = document.querySelector("#currentNode #editnode");
 
 
                     if (editCheckBox) {
                     if (editCheckBox) {
                         let mdcSwitch = editCheckBox._switch;
                         let mdcSwitch = editCheckBox._switch;
                         if (mdcSwitch) {
                         if (mdcSwitch) {
-                            if (propertyValue) {
-                                //editCheckBox.setAttribute('checked', '');
-                                //editCheckBox.classList.add("mdc-switch--checked");
-                                mdcSwitch.checked = true;
-                            } else {
-                                // let checkAttr = editCheckBox.getAttribute('checked');
-                                // if (checkAttr) editCheckBox.removeAttribute('checked');
-                                mdcSwitch.checked = false;
-                            }
+                            mdcSwitch.checked = propertyValue
                         }
                         }
                     }
                     }
                     console.log('EDIT !!! is ' + propertyValue)
                     console.log('EDIT !!! is ' + propertyValue)
-
+                }
                 }
                 }
 
 
             }
             }
+            
 
 
 
 
         },
         },