From 4e3889e80a5d6ded49701fc574b2ec91efcd9714 Mon Sep 17 00:00:00 2001 From: Matt Godbolt Date: Fri, 26 Aug 2016 16:32:25 -0500 Subject: [PATCH] Some config tweaks --- static/main.js | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/static/main.js b/static/main.js index 504d757ba..ce74917ad 100644 --- a/static/main.js +++ b/static/main.js @@ -35,26 +35,36 @@ define(function (require) { $('.language-name').text(options.language); var safeLang = options.language.toLowerCase().replace(/[^a-z_]+/g, ''); var defaultSrc = $('.template.lang.' + safeLang).text().trim(); - var config = { + var defaultConfig = { content: [{ type: 'row', - content: [{ - type: 'component', - componentName: 'codeEditor', - componentState: {} - }, { - type: 'component', - componentName: 'compilerOutput', - componentState: {} - }] + content: [ + { + type: 'component', + componentName: 'codeEditor', + componentState: {} + }, + { + type: 'column', content: [ + { + type: 'component', + componentName: 'compilerOutput', + componentState: {} + }, + { + type: 'component', + componentName: 'compilerOutput', + componentState: {} + } + ] + } + ] }] }; var root = $("#root"); // TODO: find old storage and convert var savedState = localStorage.getItem('gl'); - if (savedState !== null) { - config = JSON.parse(savedState); - } + var config = savedState !== null ? JSON.parse(savedState) : defaultConfig; var layout = new GoldenLayout(config, root); layout.on('stateChanged', function () {