From 31c01f19b3b24fc5939bd33f7fab830f4ae5965a Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 1 Sep 2016 00:01:15 +0100 Subject: [PATCH] Reorder the version selector code for clarity --- src/app.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app.js b/src/app.js index cd8140520d..097419d886 100644 --- a/src/app.js +++ b/src/app.js @@ -506,9 +506,15 @@ var run = function () { // ----------------- version selector------------- - // var soljsonSources is provided by bin/list.js - + // clear the version selector $('option', '#versionSelector').remove(); + + // load the new version upon change + $('#versionSelector').change(function () { + loadVersion($('#versionSelector').val()); + }); + + // var soljsonSources is provided by bin/list.js if (window.soljsonSources !== undefined) { $.each(soljsonSources, function (i, file) { if (file) { @@ -521,10 +527,6 @@ var run = function () { // always include the local version $('#versionSelector').append(new Option('latest local version', 'soljson.js')); - $('#versionSelector').change(function () { - loadVersion($('#versionSelector').val()); - }); - storage.sync(); };