diff --git a/site/content/en/docs/start/_index.md b/site/content/en/docs/start/_index.md index f182ec7182..9915491f3f 100644 --- a/site/content/en/docs/start/_index.md +++ b/site/content/en/docs/start/_index.md @@ -55,7 +55,7 @@ Click on the buttons that describe your target platform: {{% /quiz_row %}} {{% quiz_row base="/macOS/x86-64" name="Installer type" %}} -{{% quiz_button option="Homebrew" %}} {{% quiz_button option="Binary download" %}} +{{% quiz_button option="Binary download" %}} {{% quiz_button option="Homebrew" %}} {{% /quiz_row %}} {{% quiz_row base="/macOS/ARM64" name="Installer type" %}} @@ -67,7 +67,7 @@ Click on the buttons that describe your target platform: {{% /quiz_row %}} {{% quiz_row base="/Windows/x86-64" name="Installer type" %}} -{{% quiz_button option="Windows Package Manager" %}} {{% quiz_button option="Chocolatey" %}} {{% quiz_button option=".exe download" %}} +{{% quiz_button option=".exe download" %}} {{% quiz_button option="Windows Package Manager" %}} {{% quiz_button option="Chocolatey" %}} {{% /quiz_row %}} {{% quiz_instruction id="/Linux/x86-64/Binary download" %}} diff --git a/site/static/js/quiz.js b/site/static/js/quiz.js index afc75ec6b6..31d75f8159 100644 --- a/site/static/js/quiz.js +++ b/site/static/js/quiz.js @@ -21,9 +21,9 @@ function selectQuizOption(selectedId) { $('.quiz-instruction[data-quiz-id=\'' + selectedId + '\']').removeClass('hide'); const buttons = $('.option-row[data-quiz-id=\'' + selectedId + '\']').find('.option-button'); - // if there is only one option, auto-select that option for the user - if (buttons.length === 1) { - const btn = $(buttons[0]); + // auto-select the first option for the user, to reduce the number of clicks + if (buttons.length > 0) { + const btn = buttons.first(); btn.addClass('active'); selectQuizOption(btn.attr('data-quiz-id')); } @@ -39,15 +39,11 @@ function initQuiz() { selectQuizOption(dataContainerId); }); const userOS = getQuizUserOS(); - const buttons = $('.option-button[data-quiz-id=\'/' + userOS + '\']'); - if (buttons.length === 1) { - const btn = $(buttons[0]); - btn.addClass('active'); - selectQuizOption(btn.attr('data-quiz-id')); - } - + // auto-select the OS for user + const btn = $('.option-button[data-quiz-id=\'/' + userOS + '\']').first(); + btn.addClass('active'); + selectQuizOption(btn.attr('data-quiz-id')); } catch(e) { - console.log(e); const elements = document.getElementsByClassName("quiz-instruction"); for (let element of elements) { element.classList.remove("hide");