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(); };