From 488537ad179b0bbaf023ef937eda8ec0b9b834e4 Mon Sep 17 00:00:00 2001 From: d11e9 Date: Fri, 2 Oct 2015 18:44:23 +0100 Subject: [PATCH] fix bugs when removing all files --- index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 49f05671a0..851c8ad690 100644 --- a/index.html +++ b/index.html @@ -88,9 +88,10 @@ THE SOFTWARE. var editor = ace.edit("input"); var session = editor.getSession(); var Range = ace.require('ace/range').Range; - var errMarkerId = null; + var errMarkerId = null; var solFiles = JSON.parse( window.localStorage.getItem( SOL_CACHE_FILES_KEY ) ) || [SOL_CACHE_FILE]; + if (solFiles.length === 0) solFiles = [SOL_CACHE_FILE]; window.localStorage.setItem( SOL_CACHE_FILES_KEY, JSON.stringify( solFiles ) ); var solCache = window.localStorage.getItem( SOL_CACHE_FILE ) || BALLOT_EXAMPLE; @@ -181,6 +182,7 @@ THE SOFTWARE. var active = fileTabFromName(SOL_CACHE_FILE); active.addClass('active') editor.setValue( window.localStorage.getItem( SOL_CACHE_FILE ) || '', 1 ); + $('#input').toggle( typeof SOL_CACHE_FILE === 'string' ) } function fileTabTemplate(name){