Explorar o código

fill parent functionality will fill the entire provided screen

Raanan Weber %!s(int64=7) %!d(string=hai) anos
pai
achega
ea9e79d4ee

+ 1 - 28
Viewer/assets/templates/default/defaultTemplate.html

@@ -10,33 +10,6 @@
         font-family: "babylon";
     }
 
-    fullscreen-container {
-        width: 100%;
-        height: 100%;
-
-        display: flex;
-        flex-direction: column;
-
-        justify-content: flex-start;
-        /* align items in Main Axis */
-        align-items: stretch;
-        /* align items in Cross Axis */
-        align-content: stretch;
-        /* Extra space in Cross Axis */
-    }
-
-    fullscreen-container>* {
-        flex: 1 1 auto;
-        flex-direction: row;
-
-        justify-content: flex-start;
-        /* align items in Main Axis */
-        align-items: stretch;
-        /* align items in Cross Axis */
-        align-content: stretch;
-        /* Extra space in Cross Axis */
-    }
-
     html,
     body {
         width: 100%;
@@ -47,4 +20,4 @@
     }
 </style>
 
-<fullscreen-container></fullscreen-container>
+<fill-container></fill-container>

+ 38 - 0
Viewer/assets/templates/default/fillContainer.html

@@ -0,0 +1,38 @@
+<style>
+    fill-container {
+        display: flex;
+    }
+</style>
+
+{{#unless disable}}
+<style>
+    fill-container {
+        width: 100%;
+        height: 100%;
+        flex-direction: column;
+
+        justify-content: flex-start;
+        /* align items in Main Axis */
+        align-items: stretch;
+        /* align items in Cross Axis */
+        align-content: stretch;
+        /* Extra space in Cross Axis */
+    }
+
+    fill-container>* {
+        flex: 1 1 auto;
+        flex-direction: row;
+
+        justify-content: flex-start;
+        /* align items in Main Axis */
+        align-items: stretch;
+        /* align items in Cross Axis */
+        align-content: stretch;
+        /* Extra space in Cross Axis */
+    }
+</style>
+{{/unless}}
+
+<viewer></viewer>
+<loading-screen></loading-screen>
+<overlay></overlay>

+ 0 - 3
Viewer/assets/templates/default/fullscreenContainer.html

@@ -1,3 +0,0 @@
-<viewer></viewer>
-<loading-screen></loading-screen>
-<overlay></overlay>

+ 3 - 4
Viewer/src/configuration/types/default.ts

@@ -7,12 +7,11 @@ export let defaultConfiguration: ViewerConfiguration = {
             html: require("../../../assets/templates/default/defaultTemplate.html"),
             params: {
                 babylonFont: require('../../../assets/babylon.woff'),
-                noEscape: true,
-                fillParent: true
+                noEscape: true
             }
         },
-        fullscreenContainer: {
-            html: require("../../../assets/templates/default/fullscreenContainer.html"),
+        fillContainer: {
+            html: require("../../../assets/templates/default/fillContainer.html"),
             params: {
                 disable: false
             }

+ 1 - 0
Viewer/src/viewer/defaultViewer.ts

@@ -220,6 +220,7 @@ export class DefaultViewer extends AbstractViewer {
      */
     protected _prepareContainerElement() {
         this.containerElement.style.position = 'relative';
+        this.containerElement.style.height = '100%';
     }
 
     /**