|
@@ -2,10 +2,10 @@ var INSPECTOR;
|
|
(function (INSPECTOR) {
|
|
(function (INSPECTOR) {
|
|
var Inspector = (function () {
|
|
var Inspector = (function () {
|
|
/** The inspector is created with the given engine.
|
|
/** The inspector is created with the given engine.
|
|
- * If a HTML parent is not given as a parameter, the inspector is created as a right panel on the main window.
|
|
|
|
- * If a HTML parent is given, the inspector is created in this element, taking full size of its parent.
|
|
|
|
|
|
+ * If the parameter 'popup' is false, the inspector is created as a right panel on the main window.
|
|
|
|
+ * If the parameter 'popup' is true, the inspector is created in another popup.
|
|
*/
|
|
*/
|
|
- function Inspector(scene, parent) {
|
|
|
|
|
|
+ function Inspector(scene, popup) {
|
|
var _this = this;
|
|
var _this = this;
|
|
/** True if the inspector is built as a popup tab */
|
|
/** True if the inspector is built as a popup tab */
|
|
this._popupMode = false;
|
|
this._popupMode = false;
|
|
@@ -15,9 +15,9 @@ var INSPECTOR;
|
|
Inspector.DOCUMENT = window.document;
|
|
Inspector.DOCUMENT = window.document;
|
|
Inspector.WINDOW = window;
|
|
Inspector.WINDOW = window;
|
|
// POPUP MODE if parent is defined
|
|
// POPUP MODE if parent is defined
|
|
- if (parent) {
|
|
|
|
|
|
+ if (popup) {
|
|
// Build the inspector in the given parent
|
|
// Build the inspector in the given parent
|
|
- this._buildInspector(parent);
|
|
|
|
|
|
+ this.openPopup(true); // set to true in order to NOT dispose the inspector (done in openPopup), as it's not existing yet
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
// Get canvas and its DOM parent
|
|
// Get canvas and its DOM parent
|
|
@@ -163,8 +163,10 @@ var INSPECTOR;
|
|
INSPECTOR.Helpers.SEND_EVENT('resize');
|
|
INSPECTOR.Helpers.SEND_EVENT('resize');
|
|
}
|
|
}
|
|
};
|
|
};
|
|
- /** Open the inspector in a new popup */
|
|
|
|
- Inspector.prototype.openPopup = function () {
|
|
|
|
|
|
+ /** Open the inspector in a new popup
|
|
|
|
+ * Set 'firstTime' to true if there is no inspector created beforehands
|
|
|
|
+ */
|
|
|
|
+ Inspector.prototype.openPopup = function (firstTime) {
|
|
// Create popup
|
|
// Create popup
|
|
var popup = window.open('', 'Babylon.js INSPECTOR', 'toolbar=no,resizable=yes,menubar=no,width=750,height=1000');
|
|
var popup = window.open('', 'Babylon.js INSPECTOR', 'toolbar=no,resizable=yes,menubar=no,width=750,height=1000');
|
|
popup.document.title = 'Babylon.js INSPECTOR';
|
|
popup.document.title = 'Babylon.js INSPECTOR';
|
|
@@ -180,8 +182,10 @@ var INSPECTOR;
|
|
link.href = links[l].href;
|
|
link.href = links[l].href;
|
|
popup.document.head.appendChild(link);
|
|
popup.document.head.appendChild(link);
|
|
}
|
|
}
|
|
- // Dispose the right panel
|
|
|
|
- this.dispose();
|
|
|
|
|
|
+ // Dispose the right panel if existing
|
|
|
|
+ if (!firstTime) {
|
|
|
|
+ this.dispose();
|
|
|
|
+ }
|
|
// set the mode as popup
|
|
// set the mode as popup
|
|
this._popupMode = true;
|
|
this._popupMode = true;
|
|
// Save the HTML document
|
|
// Save the HTML document
|