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(); }