Alejandro Toledo 5 anni fa
parent
commit
9f449092c1

+ 1 - 1
inspector/src/components/popupComponent.tsx

@@ -38,7 +38,7 @@ export class PopupComponent extends React.Component<IPopupComponentProps, { isCo
 
         let windowVariableName = `window_${title}`;
 
-        this._container = Inspector._CreatePopup(title, windowVariableName, size.width, size.height);
+        this._container = Inspector._CreatePopup(title, windowVariableName, size.width, size.height, true);
 
         if (this._container) {
             this._curveEditorHost = this._container.ownerDocument!.createElement("div");

+ 7 - 5
inspector/src/inspector.ts

@@ -274,7 +274,7 @@ export class Inspector {
             ReactDOM.render(embedHostElement, this._EmbedHost);
         }
     }
-    public static _CreatePopup(title: string, windowVariableName: string, width = 300, height = 800) {
+    public static _CreatePopup(title: string, windowVariableName: string, width = 300, height = 800, lateBinding?: boolean) {
         const windowCreationOptionsList = {
             width: width,
             height: height,
@@ -316,10 +316,12 @@ export class Inspector {
 
         this._CopyStyles(window.document, parentDocument);
 
-        setTimeout(() => {
-            // need this for late bindings
-            this._CopyStyles(window.document, parentDocument);
-        }, 0);
+        if (lateBinding) {
+            setTimeout(() => {
+                // need this for late bindings
+                this._CopyStyles(window.document, parentDocument);
+            }, 0);
+        }
 
         (this as any)[windowVariableName] = popupWindow;