فهرست منبع

Bundle updated

Julian 8 سال پیش
والد
کامیت
c319c46dc3

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 4 - 4
dist/preview release/inspector/babylon.inspector.bundle.js


+ 67 - 67
dist/preview release/inspector/babylon.inspector.js

@@ -53,80 +53,80 @@ var INSPECTOR;
                     marginTop: canvasComputedStyle.marginTop,
                     marginRight: canvasComputedStyle.marginRight
                 };
-                // Create c2di wrapper
-                this._c2diwrapper = INSPECTOR.Helpers.CreateDiv('insp-wrapper');
-                // copy style from canvas to wrapper
-                for (var prop in this._canvasStyle) {
-                    this._c2diwrapper.style[prop] = this._canvasStyle[prop];
-                }
-                // Convert wrapper size in % (because getComputedStyle returns px only)
-                var widthPx = parseFloat(canvasComputedStyle.width.substr(0, canvasComputedStyle.width.length - 2)) || 0;
-                var heightPx = parseFloat(canvasComputedStyle.height.substr(0, canvasComputedStyle.height.length - 2)) || 0;
-                // If the canvas position is absolute, restrain the wrapper width to the window width + left positionning
-                if (canvasComputedStyle.position === "absolute" || canvasComputedStyle.position === "relative") {
-                    // compute only left as it takes predominance if right is also specified (and it will be for the wrapper)
-                    var leftPx = parseFloat(canvasComputedStyle.left.substr(0, canvasComputedStyle.left.length - 2)) || 0;
-                    if (widthPx + leftPx >= Inspector.WINDOW.innerWidth) {
-                        this._c2diwrapper.style.maxWidth = widthPx - leftPx + "px";
-                    }
-                }
-                // Check if the parent of the canvas is the body page. If yes, the size ratio is computed
-                var parent_1 = this._getRelativeParent(canvas);
-                var parentWidthPx = parent_1.clientWidth;
-                var parentHeightPx = parent_1.clientHeight;
-                var pWidth = widthPx / parentWidthPx * 100;
-                var pheight = heightPx / parentHeightPx * 100;
-                this._c2diwrapper.style.width = pWidth + "%";
-                this._c2diwrapper.style.height = pheight + "%";
-                // reset canvas style
-                canvas.style.position = "static";
-                canvas.style.width = "100%";
-                canvas.style.height = "100%";
-                canvas.style.paddingBottom = "0";
-                canvas.style.paddingLeft = "0";
-                canvas.style.paddingTop = "0";
-                canvas.style.paddingRight = "0";
-                canvas.style.margin = "0";
-                canvas.style.marginBottom = "0";
-                canvas.style.marginLeft = "0";
-                canvas.style.marginTop = "0";
-                canvas.style.marginRight = "0";
-                // Replace canvas with the wrapper...
-                // if (this._parentElement) {
-                //     canvasParent.replaceChild(this._parentElement, canvas);
-                //     this._parentElement.appendChild(canvas);
-                // }
-                // else {
-                canvasParent.replaceChild(this._c2diwrapper, canvas);
-                // ... and add canvas to the wrapper
-                this._c2diwrapper.appendChild(canvas);
-                // }
-                // add inspector
-                var inspector = void 0;
                 if (this._parentElement) {
-                    this._c2diwrapper.appendChild(this._parentElement);
-                    inspector = INSPECTOR.Helpers.CreateDiv('insp-right-panel', this._parentElement);
+                    // Build the inspector wrapper
+                    this._c2diwrapper = INSPECTOR.Helpers.CreateDiv('insp-wrapper', this._parentElement);
+                    this._c2diwrapper.style.width = '100%';
+                    this._c2diwrapper.style.height = '100%';
+                    this._c2diwrapper.style.paddingLeft = '5px';
+                    // add inspector     
+                    var inspector = INSPECTOR.Helpers.CreateDiv('insp-right-panel', this._c2diwrapper);
                     inspector.style.width = '100%';
                     inspector.style.height = '100%';
+                    // and build it in the popup  
+                    this._buildInspector(inspector);
                 }
                 else {
-                    inspector = INSPECTOR.Helpers.CreateDiv('insp-right-panel', this._c2diwrapper);
-                }
-                // Add split bar
-                if (!this._parentElement) {
-                    Split([canvas, inspector], {
-                        direction: 'horizontal',
-                        sizes: [75, 25],
-                        onDrag: function () {
-                            INSPECTOR.Helpers.SEND_EVENT('resize');
-                            if (_this._tabbar) {
-                                _this._tabbar.updateWidth();
-                            }
+                    // Create c2di wrapper
+                    this._c2diwrapper = INSPECTOR.Helpers.CreateDiv('insp-wrapper');
+                    // copy style from canvas to wrapper
+                    for (var prop in this._canvasStyle) {
+                        this._c2diwrapper.style[prop] = this._canvasStyle[prop];
+                    }
+                    // Convert wrapper size in % (because getComputedStyle returns px only)
+                    var widthPx = parseFloat(canvasComputedStyle.width.substr(0, canvasComputedStyle.width.length - 2)) || 0;
+                    var heightPx = parseFloat(canvasComputedStyle.height.substr(0, canvasComputedStyle.height.length - 2)) || 0;
+                    // If the canvas position is absolute, restrain the wrapper width to the window width + left positionning
+                    if (canvasComputedStyle.position === "absolute" || canvasComputedStyle.position === "relative") {
+                        // compute only left as it takes predominance if right is also specified (and it will be for the wrapper)
+                        var leftPx = parseFloat(canvasComputedStyle.left.substr(0, canvasComputedStyle.left.length - 2)) || 0;
+                        if (widthPx + leftPx >= Inspector.WINDOW.innerWidth) {
+                            this._c2diwrapper.style.maxWidth = widthPx - leftPx + "px";
                         }
-                    });
+                    }
+                    // Check if the parent of the canvas is the body page. If yes, the size ratio is computed
+                    var parent_1 = this._getRelativeParent(canvas);
+                    var parentWidthPx = parent_1.clientWidth;
+                    var parentHeightPx = parent_1.clientHeight;
+                    var pWidth = widthPx / parentWidthPx * 100;
+                    var pheight = heightPx / parentHeightPx * 100;
+                    this._c2diwrapper.style.width = pWidth + "%";
+                    this._c2diwrapper.style.height = pheight + "%";
+                    // reset canvas style
+                    canvas.style.position = "static";
+                    canvas.style.width = "100%";
+                    canvas.style.height = "100%";
+                    canvas.style.paddingBottom = "0";
+                    canvas.style.paddingLeft = "0";
+                    canvas.style.paddingTop = "0";
+                    canvas.style.paddingRight = "0";
+                    canvas.style.margin = "0";
+                    canvas.style.marginBottom = "0";
+                    canvas.style.marginLeft = "0";
+                    canvas.style.marginTop = "0";
+                    canvas.style.marginRight = "0";
+                    // Replace canvas with the wrapper...
+                    canvasParent.replaceChild(this._c2diwrapper, canvas);
+                    // ... and add canvas to the wrapper
+                    this._c2diwrapper.appendChild(canvas);
+                    // add inspector
+                    var inspector = INSPECTOR.Helpers.CreateDiv('insp-right-panel', this._c2diwrapper);
+                    // Add split bar
+                    if (!this._parentElement) {
+                        Split([canvas, inspector], {
+                            direction: 'horizontal',
+                            sizes: [75, 25],
+                            onDrag: function () {
+                                INSPECTOR.Helpers.SEND_EVENT('resize');
+                                if (_this._tabbar) {
+                                    _this._tabbar.updateWidth();
+                                }
+                            }
+                        });
+                    }
+                    // Build the inspector
+                    this._buildInspector(inspector);
                 }
-                // Build the inspector
-                this._buildInspector(inspector);
                 // Send resize event to the window
                 INSPECTOR.Helpers.SEND_EVENT('resize');
                 this._tabbar.updateWidth();

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 3 - 3
dist/preview release/inspector/babylon.inspector.min.js