From 8a8c8ab2755ed9233dd6c64b0654eea8ec09fdfd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mikel=20Mart=C3=ADn?= Date: Mon, 20 Jan 2025 13:01:13 +0100 Subject: [PATCH] MDL-75669 block_timeline: Fix sorting feature for BS5 - Because of the new BS5 syntax and changes in event listeners the sorting filter for block timeline was now working. This commit fixes the incorrect behaviour. --- blocks/timeline/amd/build/view_nav.min.js | Bin 4993 -> 4943 bytes blocks/timeline/amd/build/view_nav.min.js.map | Bin 10031 -> 9957 bytes blocks/timeline/amd/src/view_nav.js | 5 ++--- .../templates/nav-view-selector.mustache | 16 +++++++++------- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/blocks/timeline/amd/build/view_nav.min.js b/blocks/timeline/amd/build/view_nav.min.js index c406ce347865fb8cea64af051cf548964bb0cd34..95c65475de792bf45349da551c73ec71de8446de 100644 GIT binary patch delta 33 pcmZovKd-i74;Pb$=H$Ix@|y*?Bb5QcMw9|>AvWrGM<=om~i#KdZ5TrPqK0U{u=IpG4xhsq%!i7~OUvD?JP zAE60_zes<9jh(v-1%=Jd?z=NP&%FDd`EovDfo0!od)2;In?T@aNrr<*lb7Hmu;4eY zhh3Qq9ax@x3Vkm2-Co`6PZAp!mUSm(_|4jv@y(i3CrBe-aZv?Km%u@EE@4RMbg2q1 zqRWs)%;xpJ3XI5EBMT!ll#mCCHTua7{vj zDqyRpDK%x6+tHQX8v>t^(IEJw8EqTRP^6OovWMhT6v`Ddiwil#9Gmrq;hs_0`q1Fk z)GymGgHM>QXp_)Q8N+6}t6_v{hUceKT`tF-m-4gyYb?8_i1e4V2&&3?hFij>{Ef9& d$E0RK)2^^5ds}X>GgGves)$E)FTb}={s7X0pV0sS delta 623 zcmZvZK~EY%6vwkC(vV(?r(O^QrQuaBYD{~2?>SPy1?kq73ep(^Cwme%!G zs)XB-oDIY1)%Gl$T*M)d<$PY*l0h_z!>!eE?lJo!EJAU9cCno5HMy1%+?UuKHCNoQ{a0fjs6Ov=Cc9xQOlm=8XJ7f@%OGE{CGmZYC@m0(XltJ00lTf#E;ph_reJfXj^0(*0xEZFHkV8XZOd(?xv zu1wAJ#=aTJAn+wcWHq2A8InP*pTG%<=HY)w$g4Lc=xg#n*3QYwyJYyxsmU5m5^)JU zToJbV#umzV)?AuPgC%r3^qWbp9!g&`$Lap4+*w;B7Dfbt{snAGovYjO_<2lvDy*B{ X-cnUIW$r3Xj8rX+uW6yaZ#I4dp+vT} diff --git a/blocks/timeline/amd/src/view_nav.js b/blocks/timeline/amd/src/view_nav.js index 49cf234c5a3..626f35d19df 100644 --- a/blocks/timeline/amd/src/view_nav.js +++ b/blocks/timeline/amd/src/view_nav.js @@ -61,7 +61,7 @@ const registerTimelineDaySelector = function(root, timelineViewRoot) { var option = $(e.target).closest(SELECTORS.TIMELINE_DAY_FILTER_OPTION); - if (option.attr('aria-current') == 'true') { + if (option.attr('aria-selected') == 'true') { // If it's already active then we don't need to do anything. return; } @@ -109,9 +109,8 @@ const registerViewSelector = function(root, timelineViewRoot) { // Listen for when the user changes tab so that we can show the first set of courses // and load their events when they request the sort by courses view for the first time. getFirst(viewSelector).querySelectorAll('[data-bs-toggle="tab"]').forEach((tab) => { - tab.addEventListener('shown.bs.tab', (e) => { + tab.addEventListener('shown.bs.tab', () => { View.shown(timelineViewRoot); - $(e.target).removeClass('active'); }); }); diff --git a/blocks/timeline/templates/nav-view-selector.mustache b/blocks/timeline/templates/nav-view-selector.mustache index 73900a485c8..4699cc9b7ad 100644 --- a/blocks/timeline/templates/nav-view-selector.mustache +++ b/blocks/timeline/templates/nav-view-selector.mustache @@ -31,26 +31,28 @@ {{#sorttimelinedates}}{{#str}} sortbydates, block_timeline {{/str}}{{/sorttimelinedates}} -