瀏覽代碼

Add 'escape' feature when a property is updated manually

Julian 8 年之前
父節點
當前提交
87c478e915

File diff suppressed because it is too large
+ 3 - 3
dist/preview release/inspector/babylon.inspector.bundle.js


+ 6 - 0
dist/preview release/inspector/babylon.inspector.d.ts

@@ -522,6 +522,8 @@ declare module INSPECTOR {
         private _displayInputHandler;
         /** Handler used to validate the input by pressing 'enter' */
         private _validateInputHandler;
+        /** Handler used to validate the input by pressing 'esc' */
+        private _escapeInputHandler;
         constructor(prop: Property, parent?: PropertyLine, level?: number);
         /**
          * Init the input element and al its handler :
@@ -534,6 +536,10 @@ declare module INSPECTOR {
          * On escape : removes the input
          */
         private _validateInput(e);
+        /**
+         * On escape : removes the input
+         */
+        private _escapeInput(e);
         /** Removes the input without validating the new value */
         private _removeInputWithoutValidating();
         /** Replaces the default display with an input */

+ 216 - 411
dist/preview release/inspector/babylon.inspector.js

@@ -790,16 +790,11 @@ var INSPECTOR;
 
 //# sourceMappingURL=Adapter.js.map
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var CameraAdapter = (function (_super) {
@@ -853,16 +848,11 @@ var INSPECTOR;
 
 //# sourceMappingURL=CameraAdapter.js.map
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var SoundAdapter = (function (_super) {
@@ -918,16 +908,11 @@ var INSPECTOR;
 
 //# sourceMappingURL=SoundAdapter.js.map
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var TextureAdapter = (function (_super) {
@@ -964,16 +949,11 @@ var INSPECTOR;
 
 //# sourceMappingURL=TextureAdapter.js.map
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var Canvas2DAdapter = (function (_super) {
@@ -1045,16 +1025,11 @@ var INSPECTOR;
 
 //# sourceMappingURL=Canvas2DAdapter.js.map
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var LightAdapter = (function (_super) {
@@ -1120,16 +1095,11 @@ var INSPECTOR;
 
 //# sourceMappingURL=LightAdapter.js.map
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var MaterialAdapter = (function (_super) {
@@ -1191,16 +1161,11 @@ var INSPECTOR;
 
 //# sourceMappingURL=MaterialAdapter.js.map
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var MeshAdapter = (function (_super) {
@@ -1319,16 +1284,11 @@ var INSPECTOR;
 
 //# sourceMappingURL=MeshAdapter.js.map
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var DetailPanel = (function (_super) {
@@ -1612,6 +1572,7 @@ var INSPECTOR;
                 this._initInput();
                 this._valueDiv.addEventListener('click', this._displayInputHandler);
                 this._input.addEventListener('keypress', this._validateInputHandler);
+                this._input.addEventListener('keydown', this._escapeInputHandler);
             }
             // Add this property to the scheduler
             INSPECTOR.Scheduler.getInstance().add(this);
@@ -1628,6 +1589,7 @@ var INSPECTOR;
             // if the property is 'simple', add an event listener to create an input
             this._displayInputHandler = this._displayInput.bind(this);
             this._validateInputHandler = this._validateInput.bind(this);
+            this._escapeInputHandler = this._escapeInput.bind(this);
         };
         /**
          * On enter : validates the new value and removes the input
@@ -1649,6 +1611,15 @@ var INSPECTOR;
                 this.update();
             }
         };
+        /**
+         * On escape : removes the input
+         */
+        PropertyLine.prototype._escapeInput = function (e) {
+            if (e.keyCode == 27) {
+                // Esc : remove input
+                this.update();
+            }
+        };
         /** Removes the input without validating the new value */
         PropertyLine.prototype._removeInputWithoutValidating = function () {
             INSPECTOR.Helpers.CleanDiv(this._valueDiv);
@@ -1859,16 +1830,11 @@ var INSPECTOR;
 
 //# sourceMappingURL=PropertyLine.js.map
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     /**
@@ -1910,16 +1876,11 @@ var INSPECTOR;
 
 //# sourceMappingURL=ColorElement.js.map
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     /**
@@ -1947,7 +1908,6 @@ var INSPECTOR;
         }
         CubeTextureElement.prototype.update = function (tex) {
             if (tex && tex.url === this._textureUrl) {
-                // Nothing to do, as the old texture is the same as the old one
             }
             else {
                 if (tex) {
@@ -2029,16 +1989,11 @@ var INSPECTOR;
 
 //# sourceMappingURL=CubeTextureElement.js.map
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     /**
@@ -2073,16 +2028,11 @@ var INSPECTOR;
     INSPECTOR.HDRCubeTextureElement = HDRCubeTextureElement;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     /**
@@ -2120,16 +2070,11 @@ var INSPECTOR;
     INSPECTOR.SearchBar = SearchBar;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     /**
@@ -2391,16 +2336,11 @@ var INSPECTOR;
     INSPECTOR.Scheduler = Scheduler;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var Tab = (function (_super) {
@@ -2468,16 +2408,11 @@ var INSPECTOR;
     INSPECTOR.Tab = Tab;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     /**
@@ -2609,16 +2544,11 @@ var INSPECTOR;
     INSPECTOR.PropertyTab = PropertyTab;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var CameraTab = (function (_super) {
@@ -2642,16 +2572,11 @@ var INSPECTOR;
     INSPECTOR.CameraTab = CameraTab;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var SoundTab = (function (_super) {
@@ -2679,16 +2604,11 @@ var INSPECTOR;
     INSPECTOR.SoundTab = SoundTab;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var TextureTab = (function (_super) {
@@ -2810,16 +2730,11 @@ var INSPECTOR;
     INSPECTOR.TextureTab = TextureTab;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var Canvas2DTab = (function (_super) {
@@ -2867,16 +2782,11 @@ var INSPECTOR;
     INSPECTOR.Canvas2DTab = Canvas2DTab;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var LightTab = (function (_super) {
@@ -2900,16 +2810,11 @@ var INSPECTOR;
     INSPECTOR.LightTab = LightTab;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var MaterialTab = (function (_super) {
@@ -2933,16 +2838,11 @@ var INSPECTOR;
     INSPECTOR.MaterialTab = MaterialTab;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var MeshTab = (function (_super) {
@@ -2999,16 +2899,11 @@ var INSPECTOR;
     INSPECTOR.MeshTab = MeshTab;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var SceneTab = (function (_super) {
@@ -3181,16 +3076,11 @@ var INSPECTOR;
     INSPECTOR.SceneTab = SceneTab;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var ShaderTab = (function (_super) {
@@ -3315,16 +3205,11 @@ var INSPECTOR;
     INSPECTOR.ShaderTab = ShaderTab;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     /**
@@ -3449,16 +3334,11 @@ var INSPECTOR;
     INSPECTOR.ConsoleTab = ConsoleTab;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var StatsTab = (function (_super) {
@@ -3730,16 +3610,11 @@ var INSPECTOR;
     INSPECTOR.StatsTab = StatsTab;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     /**
@@ -3968,16 +3843,11 @@ var INSPECTOR;
     INSPECTOR.AbstractTool = AbstractTool;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var PauseScheduleTool = (function (_super) {
@@ -4004,16 +3874,11 @@ var INSPECTOR;
     INSPECTOR.PauseScheduleTool = PauseScheduleTool;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var PickTool = (function (_super) {
@@ -4066,16 +3931,11 @@ var INSPECTOR;
     INSPECTOR.PickTool = PickTool;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var PopupTool = (function (_super) {
@@ -4092,16 +3952,11 @@ var INSPECTOR;
     INSPECTOR.PopupTool = PopupTool;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var RefreshTool = (function (_super) {
@@ -4118,16 +3973,11 @@ var INSPECTOR;
     INSPECTOR.RefreshTool = RefreshTool;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var LabelTool = (function (_super) {
@@ -4271,16 +4121,11 @@ var INSPECTOR;
     INSPECTOR.LabelTool = LabelTool;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var Toolbar = (function (_super) {
@@ -4334,16 +4179,11 @@ var INSPECTOR;
     INSPECTOR.Toolbar = Toolbar;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     /**
@@ -4363,16 +4203,11 @@ var INSPECTOR;
     INSPECTOR.DisposeTool = DisposeTool;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var TreeItem = (function (_super) {
@@ -4581,16 +4416,11 @@ var INSPECTOR;
     INSPECTOR.AbstractTreeTool = AbstractTreeTool;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     /**
@@ -4628,16 +4458,11 @@ var INSPECTOR;
     INSPECTOR.BoundingBox = BoundingBox;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     /**
@@ -4672,16 +4497,11 @@ var INSPECTOR;
     INSPECTOR.CameraPOV = CameraPOV;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     /**
@@ -4720,16 +4540,11 @@ var INSPECTOR;
     INSPECTOR.SoundInteractions = SoundInteractions;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     /**
@@ -4773,16 +4588,11 @@ var INSPECTOR;
     INSPECTOR.Checkbox = Checkbox;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     var DebugArea = (function (_super) {
@@ -4810,16 +4620,11 @@ var INSPECTOR;
     INSPECTOR.DebugArea = DebugArea;
 })(INSPECTOR || (INSPECTOR = {}));
 
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var INSPECTOR;
 (function (INSPECTOR) {
     /**

File diff suppressed because it is too large
+ 3 - 3
dist/preview release/inspector/babylon.inspector.min.js


+ 87 - 73
inspector/src/details/PropertyLine.ts

@@ -5,14 +5,14 @@ module INSPECTOR {
         /**
          * Format the value of the given property of the given object.
          */
-        public static format(obj: any, prop:string) : string {
+        public static format(obj: any, prop: string): string {
             // Get original value;
             let value = obj[prop];
             // test if type PrimitiveAlignment is available (only included in canvas2d)
-            if (BABYLON.PrimitiveAlignment) {                
+            if (BABYLON.PrimitiveAlignment) {
                 if (obj instanceof BABYLON.PrimitiveAlignment) {
                     if (prop === 'horizontal') {
-                        switch(value) {
+                        switch (value) {
                             case BABYLON.PrimitiveAlignment.AlignLeft:
                                 return 'left';
                             case BABYLON.PrimitiveAlignment.AlignRight:
@@ -23,7 +23,7 @@ module INSPECTOR {
                                 return 'stretch';
                         }
                     } else if (prop === 'vertical') {
-                        switch(value) {
+                        switch (value) {
                             case BABYLON.PrimitiveAlignment.AlignTop:
                                 return 'top';
                             case BABYLON.PrimitiveAlignment.AlignBottom:
@@ -54,66 +54,69 @@ module INSPECTOR {
      * 
      */
     export class PropertyLine {
-        
+
         // The property can be of any type (Property internally can have any type), relative to this._obj
-        private _property : Property;    
+        private _property: Property;
         //The HTML element corresponding to this line
-        private _div : HTMLElement;
+        private _div: HTMLElement;
         // The div containing the value to display. Used to update dynamically the property
-        private _valueDiv : HTMLElement;
+        private _valueDiv: HTMLElement;
         // If the type is complex, this property will have child to update
-        private _children : Array<PropertyLine> = [];        
+        private _children: Array<PropertyLine> = [];
         // Array representing the simple type. All others are considered 'complex'
         private static _SIMPLE_TYPE = ['number', 'string', 'boolean'];
         // The number of pixel at each children step
         private static _MARGIN_LEFT = 15;
         // The margin-left used to display to row
-        private _level : number;
+        private _level: number;
         /** The list of viewer element displayed at the end of the line (color, texture...) */
-        private _elements : Array<BasicElement> = [];
+        private _elements: Array<BasicElement> = [];
         /** The property parent of this one. Used to update the value of this property and to retrieve the correct object */
-        private _parent : PropertyLine;
+        private _parent: PropertyLine;
         /** The input element to display if this property is 'simple' in order to update it */
-        private _input : HTMLInputElement;
+        private _input: HTMLInputElement;
         /** Display input handler (stored to be removed afterwards) */
-        private _displayInputHandler : EventListener;
+        private _displayInputHandler: EventListener;
         /** Handler used to validate the input by pressing 'enter' */
-        private _validateInputHandler : EventListener;
-        
-        constructor(prop : Property, parent?: PropertyLine, level:number=0) {
+        private _validateInputHandler: EventListener;
+        /** Handler used to validate the input by pressing 'esc' */
+        private _escapeInputHandler: EventListener;
+
+        constructor(prop: Property, parent?: PropertyLine, level: number = 0) {
             this._property = prop;
-            this._level    = level;       
-            this._parent   = parent;   
-                         
+            this._level = level;
+            this._parent = parent;
+
             this._div = Helpers.CreateDiv('row');
             this._div.style.marginLeft = `${this._level}px`;
-            
+
             // Property name
-            let propName : HTMLElement = Helpers.CreateDiv('prop-name', this._div);
+            let propName: HTMLElement = Helpers.CreateDiv('prop-name', this._div);
             propName.textContent = `${this.name}`;
 
             // Value
             this._valueDiv = Helpers.CreateDiv('prop-value', this._div);
             this._valueDiv.textContent = this._displayValueContent() || '-'; // Init value text node
-            
+
             this._createElements();
-            
+
             for (let elem of this._elements) {
                 this._valueDiv.appendChild(elem.toHtml());
             }
-            
+
             this._updateValue();
 
             // If the property type is not simple, add click event to unfold its children
-            if (!this._isSimple()) { 
+            if (!this._isSimple()) {
                 this._valueDiv.classList.add('clickable');
                 this._valueDiv.addEventListener('click', this._addDetails.bind(this));
             } else {
                 this._initInput();
                 this._valueDiv.addEventListener('click', this._displayInputHandler);
                 this._input.addEventListener('keypress', this._validateInputHandler);
+                this._input.addEventListener('keydown', this._escapeInputHandler);
             }
-            
+
             // Add this property to the scheduler
             Scheduler.getInstance().add(this);
         }
@@ -124,21 +127,22 @@ module INSPECTOR {
          * - enters updates the property
          */
         private _initInput() {
-            
+
             // Create the input element
             this._input = document.createElement('input') as HTMLInputElement;
             this._input.setAttribute('type', 'text');
 
             // if the property is 'simple', add an event listener to create an input
-            this._displayInputHandler  = this._displayInput.bind(this);
+            this._displayInputHandler = this._displayInput.bind(this);
             this._validateInputHandler = this._validateInput.bind(this);
+            this._escapeInputHandler = this._escapeInput.bind(this);
         }
 
         /** 
          * On enter : validates the new value and removes the input
          * On escape : removes the input
          */
-        private _validateInput(e : KeyboardEvent) {
+        private _validateInput(e: KeyboardEvent) {
             if (e.keyCode == 13) {
                 // Enter : validate the new value
                 let newValue = this._input.value;
@@ -148,8 +152,18 @@ module INSPECTOR {
                 this.update();
                 // resume scheduler
                 Scheduler.getInstance().pause = false;
-                
-            } else if (e.keyCode == 27) { 
+
+            } else if (e.keyCode == 27) {
+                // Esc : remove input
+                this.update();
+            }
+        }
+
+        /** 
+         * On escape : removes the input
+         */
+        private _escapeInput(e: KeyboardEvent) {
+            if (e.keyCode == 27) {
                 // Esc : remove input
                 this.update();
             }
@@ -162,7 +176,7 @@ module INSPECTOR {
             // restore elements
             for (let elem of this._elements) {
                 this._valueDiv.appendChild(elem.toHtml());
-            }            
+            }
             this._valueDiv.addEventListener('click', this._displayInputHandler);
         }
 
@@ -176,7 +190,7 @@ module INSPECTOR {
             this._valueDiv.textContent = "";
             this._input.value = valueTxt;
             this._valueDiv.appendChild(this._input);
-            
+
             // Pause the scheduler
             Scheduler.getInstance().pause = true;
         }
@@ -190,76 +204,76 @@ module INSPECTOR {
             if (this._parent) {
                 this._property.obj = this._parent.updateObject();
             }
-            return this._property.value;            
+            return this._property.value;
         }
 
         // Returns the property name
-        public get name() : string {
+        public get name(): string {
             return this._property.name;
         }
 
         // Returns the value of the property
-        public get value() : any {
+        public get value(): any {
             return PropertyFormatter.format(this._property.obj, this._property.name);
         }
 
         // Returns the type of the property
-        public get type() : string {
+        public get type(): string {
             return this._property.type;
         }
-        
+
         /**
          * Creates elements that wil be displayed on a property line, depending on the
          * type of the property.
          */
         private _createElements() {
-            
+
             // Colors
-            if (this.type == 'Color3' ||this.type == 'Color4') {
+            if (this.type == 'Color3' || this.type == 'Color4') {
                 this._elements.push(new ColorElement(this.value));
-            } 
+            }
             // Texture
             if (this.type == 'Texture') {
                 this._elements.push(new TextureElement(this.value));
-            }   
+            }
             // HDR Texture
             if (this.type == 'HDRCubeTexture') {
                 this._elements.push(new HDRCubeTextureElement(this.value));
-            }      
+            }
             if (this.type == 'CubeTexture') {
                 this._elements.push(new CubeTextureElement(this.value));
-            }      
+            }
         }
 
         // Returns the text displayed on the left of the property name : 
         // - If the type is simple, display its value
         // - If the type is complex, but instance of Vector2, Size, display the type and its tostring
         // - If the type is another one, display the Type
-        private _displayValueContent () {
-            
+        private _displayValueContent() {
+
             let value = this.value;
             // If the value is a number, truncate it if needed
             if (typeof value === 'number') {
-                return Helpers.Trunc(value);                
-            } 
+                return Helpers.Trunc(value);
+            }
             // If it's a string or a boolean, display its value
             if (typeof value === 'string' || typeof value === 'boolean') {
-                return value;          
-            } 
+                return value;
+            }
             return PROPERTIES.format(value);
-            
+
         }
-        
+
         /** Delete properly this property line. 
          * Removes itself from the scheduler.
          * Dispose all viewer element (color, texture...)
          */
         public dispose() {
             // console.log('delete properties', this.name);
-            Scheduler.getInstance().remove(this); 
+            Scheduler.getInstance().remove(this);
             for (let child of this._children) {
                 // console.log('delete properties', child.name);
-                Scheduler.getInstance().remove(child); 
+                Scheduler.getInstance().remove(child);
             }
             for (let elem of this._elements) {
                 elem.dispose();
@@ -281,20 +295,20 @@ module INSPECTOR {
                 elem.update(this.value);
             }
         }
-        
+
         /**
          * Update the property division with the new property value. 
          * If this property is complex, update its child, otherwise update its text content
          */
-        public update() {            
-           this._removeInputWithoutValidating();
-           this._updateValue();
+        public update() {
+            this._removeInputWithoutValidating();
+            this._updateValue();
         }
-        
+
         /**
          * Returns true if the given instance is a simple type  
          */
-        private static _IS_TYPE_SIMPLE(inst:any) {
+        private static _IS_TYPE_SIMPLE(inst: any) {
             let type = Helpers.GET_TYPE(inst);
             return PropertyLine._SIMPLE_TYPE.indexOf(type) != -1;
         }
@@ -303,21 +317,21 @@ module INSPECTOR {
          * Returns true if the type of this property is simple, false otherwise.
          * Returns true if the value is null
          */
-        private _isSimple() : boolean {
+        private _isSimple(): boolean {
             if (this.value != null && this.type !== 'type_not_defined') {
                 if (PropertyLine._SIMPLE_TYPE.indexOf(this.type) == -1) {
                     // complex type : return the type name
                     return false;
                 } else {
                     // simple type : return value
-                    return true; 
+                    return true;
                 }
             } else {
                 return true;
             }
         }
 
-        public toHtml() : HTMLElement {
+        public toHtml(): HTMLElement {
             return this._div;
         }
 
@@ -325,7 +339,7 @@ module INSPECTOR {
          * Add sub properties in case of a complex type
          */
         private _addDetails() {
-            if (this._div.classList.contains('unfolded')) {            
+            if (this._div.classList.contains('unfolded')) {
                 // Remove class unfolded
                 this._div.classList.remove('unfolded');
                 // remove html children
@@ -335,23 +349,23 @@ module INSPECTOR {
             } else {
                 // if children does not exists, generate it
                 this._div.classList.toggle('unfolded');
-                if (this._children.length ==0) {                    
+                if (this._children.length == 0) {
                     let objToDetail = this.value;
                     let propToDisplay = PROPERTIES[Helpers.GET_TYPE(objToDetail)].properties.reverse();
                     let propertyLine = null;
-                    
+
                     for (let prop of propToDisplay) {
                         let infos = new Property(prop, this._property.value);
-                        let child = new PropertyLine(infos, this, this._level+PropertyLine._MARGIN_LEFT);
+                        let child = new PropertyLine(infos, this, this._level + PropertyLine._MARGIN_LEFT);
                         this._children.push(child);
                     }
-                } 
+                }
                 // otherwise display it                    
                 for (let child of this._children) {
                     this._div.parentNode.insertBefore(child.toHtml(), this._div.nextSibling);
                 }
-            }            
-        }        
-    } 
-    
+            }
+        }
+    }
+
 }