From f96c0d254be361a0754d804f58b5d80f40986151 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 7 Sep 2016 23:28:07 +0100 Subject: [PATCH] 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();