From f96c0d254be361a0754d804f58b5d80f40986151 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 7 Sep 2016 23:28:07 +0100 Subject: [PATCH 1/2] Remove instant updates from the url.hash This wasn't fully working and would create a complex code (at least now) --- src/app.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/app.js b/src/app.js index 73339bf781..ebf7f95af4 100644 --- a/src/app.js +++ b/src/app.js @@ -53,15 +53,6 @@ var run = function () { loadFiles(filesToLoad); } - // ------------------ query params (hash) ---------------- - - function syncQueryParams () { - $('#optimize').attr('checked', (queryParams.get().optimize === 'true')); - } - - window.onhashchange = syncQueryParams; - syncQueryParams(); - // -------- check file upload capabilities ------- if (!(window.File || window.FileReader || window.FileList || window.Blob)) { @@ -531,6 +522,9 @@ var run = function () { } } + // set default + $('#optimize').attr('checked', (queryParams.get().optimize === 'true')); + document.querySelector('#optimize').addEventListener('change', function () { queryParams.update({ optimize: document.querySelector('#optimize').checked }); compiler.compile(); From eed3d0ab82c9a9c3083d5815149f6641f4852505 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 7 Sep 2016 23:31:18 +0100 Subject: [PATCH 2/2] Merge initWithQueryParams --- src/app.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/app.js b/src/app.js index ebf7f95af4..1d29dd766e 100644 --- a/src/app.js +++ b/src/app.js @@ -479,10 +479,7 @@ var run = function () { previousInput = ''; setVersionText(version); compiler.compile(); - initWithQueryParams(); - }); - function initWithQueryParams () { if (queryParams.get().endpointurl) { executionContext.setEndPointUrl(queryParams.get().endpointurl); } @@ -492,7 +489,7 @@ var run = function () { if (queryParams.get().debugtx) { startdebugging(queryParams.get().debugtx); } - } + }); function startdebugging (txHash) { transactionDebugger.debug(txHash); @@ -504,7 +501,7 @@ var run = function () { } function loadVersion (version) { - queryParams.update({version: version}); + queryParams.update({ version: version }); var url; if (version === 'builtin') { url = 'soljson.js';