From 27c2f27708728213e65eeff060b40157c5d27623 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Thu, 13 Jan 2022 02:18:40 +0000 Subject: [PATCH] Show and hide the splitter with the editor so that it doesn't shift the content to the right when the editor is hidden. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3757 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- core/client.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/client.js b/core/client.js index fec464d6..11c46d17 100644 --- a/core/client.js +++ b/core/client.js @@ -7,6 +7,7 @@ var gCurrentFile; var gFiles = {}; var gApp = {files: {}}; var gEditor; +var gSplit; var kErrorColor = "#dc322f"; var kStatusColor = "#fff"; @@ -76,6 +77,8 @@ function edit() { return; } + gSplit = Split(['#editPane', '#viewPane'], {minSize: 0}); + ensureLoaded([ {tagName: "script", attributes: {src: "/static/codemirror/codemirror.min.js"}}, {tagName: "link", attributes: {rel: "stylesheet", href: "/static/codemirror/base16-dark.min.css"}}, @@ -251,6 +254,8 @@ function load() { function closeEditor() { document.getElementById("editPane").style.display = 'none'; + gSplit.destroy(); + gSplit = undefined; } function explodePath() { @@ -700,7 +705,6 @@ function removeFile() { } window.addEventListener("load", function() { - Split(['#editPane', '#viewPane'], {minSize: 0}); if (window.Notification) { Notification.requestPermission(); }