Selaa lähdekoodia

Fix order details #2827

QuentinRillet 8 vuotta sitten
vanhempi
commit
73e2353267

+ 3 - 3
dist/preview release/inspector/babylon.inspector.css

@@ -85,14 +85,14 @@
     .insp-wrapper .treeTool.active {
       color: #5db0d7; }
   .insp-wrapper .tab-panel {
-    height: 100%;
-    overflow-y: auto; }
+    height: 100%; }
     .insp-wrapper .tab-panel.searchable {
       height: calc(100% - 30px - 10px); }
     .insp-wrapper .tab-panel .texture-image {
       max-height: 400px; }
     .insp-wrapper .tab-panel .scene-actions {
-      overflow-y: auto; }
+      overflow-y: auto;
+      padding-left: 5px; }
       .insp-wrapper .tab-panel .scene-actions .actions-title {
         font-size: 1.1em;
         padding-bottom: 10px;

+ 4 - 0
inspector/src/details/DetailPanel.ts

@@ -84,6 +84,10 @@
                 return typeof(s) === 'string' || s instanceof String;
             };
 
+            this._detailRows.forEach((property) => {
+                property.closeDetails();
+            })
+
             this._detailRows.sort((detail1, detail2) : number => {
                 let str1 = String(detail1[property]);
                 let str2 = String(detail2[property]);

+ 11 - 1
inspector/src/details/PropertyLine.ts

@@ -385,6 +385,16 @@ module INSPECTOR {
             return this._div;
         }
 
+        public closeDetails() {
+            if (this._div.classList.contains('unfolded')) {
+                // Remove class unfolded
+                this._div.classList.remove('unfolded');
+                // remove html children
+                for (let child of this._children) {
+                    this._div.parentNode.removeChild(child.toHtml());
+                }
+            }
+        }
         /**
          * Add sub properties in case of a complex type
          */
@@ -401,7 +411,7 @@ module INSPECTOR {
                 this._div.classList.toggle('unfolded');
                 if (this._children.length == 0) {
                     let objToDetail = this.value;
-                    let propToDisplay = PROPERTIES[Helpers.GET_TYPE(objToDetail)].properties.reverse();
+                    let propToDisplay = PROPERTIES[Helpers.GET_TYPE(objToDetail)].properties.slice().reverse();
                     let propertyLine = null;
 
                     for (let prop of propToDisplay) {