Browse Source

Prevent display two checkbox

QuentinRillet 8 years ago
parent
commit
2ddb8e95d6
1 changed files with 9 additions and 7 deletions
  1. 9 7
      inspector/src/details/PropertyLine.ts

+ 9 - 7
inspector/src/details/PropertyLine.ts

@@ -440,13 +440,15 @@ module INSPECTOR {
         }
         }
 
 
         private _checkboxInput() {
         private _checkboxInput() {
-            this._input_checkbox = Helpers.CreateInput('checkbox-element', this._valueDiv);
-            this._input_checkbox.type = 'checkbox'
-            this._input_checkbox.checked = this.value;
-            this._input_checkbox.addEventListener('change', () => {
-                Scheduler.getInstance().pause = true;
-                this.validateInput(!this.value)
-            })
+            if(this._valueDiv.childElementCount < 1) { // Prevent display two checkbox
+                this._input_checkbox = Helpers.CreateInput('checkbox-element', this._valueDiv);
+                this._input_checkbox.type = 'checkbox'
+                this._input_checkbox.checked = this.value;
+                this._input_checkbox.addEventListener('change', () => {
+                    Scheduler.getInstance().pause = true;
+                    this.validateInput(!this.value)
+                })
+            }            
         }
         }
     }
     }
 }
 }