소스 검색

Fix editor switch for PG

David Catuhe 5 년 전
부모
커밋
5749b64e57
2개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      Playground/js/index.js
  2. 8 0
      Playground/js/main.js

+ 1 - 1
Playground/js/index.js

@@ -12,7 +12,7 @@
         /**
          * View split
          */
-        this.splitInstance = Split(['#jsEditor', '#canvasZone']);
+        this.splitInstance = Split(['#jsEditor', '#canvasZone'], {minSize: 0});
 
         /**
          * Run the main script

+ 8 - 0
Playground/js/main.js

@@ -947,15 +947,23 @@ class Main {
      */
     toggleEditor() {
         var editorButton = document.getElementById("editorButton1280");
+        var gutter = document.querySelector(".gutter");
+        var canvas = document.getElementById("canvasZone");
+        var jsEditor = document.getElementById("jsEditor");
         var scene = engine.scenes[0];
 
         // If the editor is present
         if (editorButton.classList.contains('checked')) {
             this.parent.utils.setToMultipleID("editorButton", "removeClass", 'checked');
+            gutter.style.display = "none";
+            jsEditor.style.display = "none";
             this.parent.splitInstance.collapse(0);
+            canvas.style.width = "100%";
             this.parent.utils.setToMultipleID("editorButton", "innerHTML", 'Editor <i class="fa fa-square" aria-hidden="true"></i>');
         } else {
             this.parent.utils.setToMultipleID("editorButton", "addClass", 'checked');
+            gutter.style.display = "";            
+            jsEditor.style.display = "";
             this.parent.splitInstance.setSizes([50, 50]); // Reset
             this.parent.utils.setToMultipleID("editorButton", "innerHTML", 'Editor <i class="fa fa-check-square" aria-hidden="true"></i>');
         }