From 217e031a5532c05cd67c8273639ae86ce94b46c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Thom=C3=A9?= Date: Mon, 17 May 2021 20:43:01 -0300 Subject: [PATCH 1/3] add toggler --- src/js/settings.js | 84 +++++++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 38 deletions(-) diff --git a/src/js/settings.js b/src/js/settings.js index 8ae870538..88b3e0536 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -562,6 +562,46 @@ export function update() { } } +function toggleSettingsGroup(groupName) { + $(`.pageSettings .settingsGroup.${groupName}`) + .stop(true, true) + .slideToggle(250) + .toggleClass("slideup"); + if ($(`.pageSettings .settingsGroup.${groupName}`).hasClass("slideup")) { + $(`.pageSettings .sectionGroupTitle[group=${groupName}] .fas`) + .stop(true, true) + .animate( + { + deg: -90, + }, + { + duration: 250, + step: function (now) { + $(this).css({ + transform: "rotate(" + now + "deg)", + }); + }, + } + ); + } else { + $(`.pageSettings .sectionGroupTitle[group=${groupName}] .fas`) + .stop(true, true) + .animate( + { + deg: 0, + }, + { + duration: 250, + step: function (now) { + $(this).css({ + transform: "rotate(" + now + "deg)", + }); + }, + } + ); + } +} + $(document).on( "focusout", ".pageSettings .section.paceCaret input.customPaceCaretSpeed", @@ -763,44 +803,7 @@ $("#exportSettingsButton").click((e) => { }); $(".pageSettings .sectionGroupTitle").click((e) => { - let group = $(e.currentTarget).attr("group"); - $(`.pageSettings .settingsGroup.${group}`) - .stop(true, true) - .slideToggle(250) - .toggleClass("slideup"); - if ($(`.pageSettings .settingsGroup.${group}`).hasClass("slideup")) { - $(`.pageSettings .sectionGroupTitle[group=${group}] .fas`) - .stop(true, true) - .animate( - { - deg: -90, - }, - { - duration: 250, - step: function (now) { - $(this).css({ - transform: "rotate(" + now + "deg)", - }); - }, - } - ); - } else { - $(`.pageSettings .sectionGroupTitle[group=${group}] .fas`) - .stop(true, true) - .animate( - { - deg: 0, - }, - { - duration: 250, - step: function (now) { - $(this).css({ - transform: "rotate(" + now + "deg)", - }); - }, - } - ); - } + toggleSettingsGroup($(e.currentTarget).attr("group")); }); $(".pageSettings #resetPersonalBestsButton").on("click", (e) => { @@ -854,3 +857,8 @@ $(".pageSettings .section.customLayoutfluid .inputAndSave .input").keypress( } } ); + +$(".quickNav .links a").on("click", (e) => { + const settingsGroup = e.target.innerText; + toggleSettingsGroup(settingsGroup); +}); From bcb06bd57c395f9a770cabdace28ba33e11e5ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Thom=C3=A9?= Date: Tue, 18 May 2021 13:46:31 -0300 Subject: [PATCH 2/3] fix open settings getting closed --- src/js/settings.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/settings.js b/src/js/settings.js index 88b3e0536..a3c03a8a2 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -860,5 +860,8 @@ $(".pageSettings .section.customLayoutfluid .inputAndSave .input").keypress( $(".quickNav .links a").on("click", (e) => { const settingsGroup = e.target.innerText; - toggleSettingsGroup(settingsGroup); + const isOpen = $(`.pageSettings .settingsGroup.${settingsGroup}`).hasClass( + "slideup" + ); + isOpen && toggleSettingsGroup(settingsGroup); }); From 044c96b7356e4d7a32bb98b1bf657bbd773cac69 Mon Sep 17 00:00:00 2001 From: Saint-dev Date: Tue, 18 May 2021 15:10:50 -0400 Subject: [PATCH 3/3] fixed unable to change funbox on results screen --- src/js/test/funbox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/test/funbox.js b/src/js/test/funbox.js index 9d97494f0..0e5f8fc53 100644 --- a/src/js/test/funbox.js +++ b/src/js/test/funbox.js @@ -165,7 +165,7 @@ export async function activate(funbox, mode) { return true; } export function setFunbox(funbox, mode) { - if (TestLogic.active || TestUI.resultVisible) { + if (TestLogic.active) { Notifications.add( "You can only change the funbox before starting a test.", 0