From 4d0b02a50ebaf72fda1fa9194663109997ba4089 Mon Sep 17 00:00:00 2001 From: Bas Brands Date: Tue, 2 Jun 2020 15:51:44 +0200 Subject: [PATCH] MDL-68889 block_recentlyaccessedcourses: small viewport issues - on small devices the recentlyaccessedcourses does not show any courses --- .../amd/build/main.min.js | Bin 3642 -> 3656 bytes .../amd/build/main.min.js.map | Bin 23412 -> 23621 bytes .../recentlyaccessedcourses/amd/src/main.js | 5 +++++ theme/boost/scss/moodle/blocks.scss | 10 ++++++---- theme/boost/style/moodle.css | 6 ++++-- theme/classic/style/moodle.css | 6 ++++-- 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/blocks/recentlyaccessedcourses/amd/build/main.min.js b/blocks/recentlyaccessedcourses/amd/build/main.min.js index 54f17c88ade4e309bdaf7cb5e28cc72a22cebca9..91540413a747553d4c57926e38ea8bb4ddb54af4 100644 GIT binary patch delta 26 hcmdlbb3$f=IR|fMnudX`t!;s3b%CwnW-|^JHUM&l2Z8_q delta 12 TcmX>hvrA@!Imc#K4rVq09>@c; diff --git a/blocks/recentlyaccessedcourses/amd/build/main.min.js.map b/blocks/recentlyaccessedcourses/amd/build/main.min.js.map index 7d74c0febe14978e34cfddcdf6d239639458ed24..c2da9f587935bca723dfbb18e0cdb5254d00e0d7 100644 GIT binary patch delta 207 zcmeyejq&IX#tpI}9_}tW?v9QYPCCwxj)qPkwxg*th~ot!GC@pdb0FaDg{YcOs*A~&1vbB3F72BZ&nnwVP?XIv zVrMrD260L^hbru2WXcHNEUL6XUQ%CQ!LdXkCpEFSM4>n%zg!_dFI6Equ_$G-qqE3l hZZ}a@TU%QNgUJiML?_EQNH7{s{$sDOd8^}oNdUfLJca-O delta 97 zcmX@QgYnBY#tpI}JVj0h&N}XnrA}qe-jh>Bd^pOSN}Y6^9V;jA6q(Ig<&+8HSU7Et x6}4ezH}~}b^71z?ka)$;UK9-CWN)6Ru#b_+IBavE(gOL({&sAedz^Mk0st&|ASVC- diff --git a/blocks/recentlyaccessedcourses/amd/src/main.js b/blocks/recentlyaccessedcourses/amd/src/main.js index 9af85cb9091..423eeb0abe3 100644 --- a/blocks/recentlyaccessedcourses/amd/src/main.js +++ b/blocks/recentlyaccessedcourses/amd/src/main.js @@ -210,6 +210,11 @@ define( start = start >= 0 ? start : 0; } + // At least show one card. + if (availableVisibleCards === 0) { + availableVisibleCards = 1; + } + var coursesToShow = allCourses.slice(start, start + availableVisibleCards); // Create an id for the list of courses we expect to be displayed. var newVisibleCoursesId = coursesToShow.reduce(function(carry, course) { diff --git a/theme/boost/scss/moodle/blocks.scss b/theme/boost/scss/moodle/blocks.scss index 8ca75104b73..235b190842d 100644 --- a/theme/boost/scss/moodle/blocks.scss +++ b/theme/boost/scss/moodle/blocks.scss @@ -170,10 +170,12 @@ $card-gutter : $card-deck-margin * 2; padding: 0.8rem; } } - - &.fixed-width-cards { - .dashboard-card { - width: 300px; + @include media-breakpoint-up(sm) { + &.fixed-width-cards { + .dashboard-card { + width: 300px; + max-width: 100%; + } } } } diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index 6420d420244..f6335de262d 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -12577,8 +12577,10 @@ body.h5p-embed .h5pmessages { .dashboard-card-deck .dashboard-card .dashboard-card-footer { padding: 0.8rem; } -.dashboard-card-deck.fixed-width-cards .dashboard-card { - width: 300px; } +@media (min-width: 576px) { + .dashboard-card-deck.fixed-width-cards .dashboard-card { + width: 300px; + max-width: 100%; } } @media (min-width: 576px) { .dashboard-card-deck:not(.fixed-width-cards) .dashboard-card { diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index b64067e1eac..ab465e9d934 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -12792,8 +12792,10 @@ body.h5p-embed .h5pmessages { .dashboard-card-deck .dashboard-card .dashboard-card-footer { padding: 0.8rem; } -.dashboard-card-deck.fixed-width-cards .dashboard-card { - width: 300px; } +@media (min-width: 576px) { + .dashboard-card-deck.fixed-width-cards .dashboard-card { + width: 300px; + max-width: 100%; } } @media (min-width: 576px) { .dashboard-card-deck:not(.fixed-width-cards) .dashboard-card { -- 2.43.0