MDL-68889 block_recentlyaccessedcourses: small viewport issues
authorBas Brands <bas@moodle.com>
Tue, 2 Jun 2020 13:51:44 +0000 (15:51 +0200)
committerBas Brands <bas@moodle.com>
Wed, 12 Aug 2020 11:04:08 +0000 (13:04 +0200)
- on small devices the recentlyaccessedcourses does not show any courses

blocks/recentlyaccessedcourses/amd/build/main.min.js
blocks/recentlyaccessedcourses/amd/build/main.min.js.map
blocks/recentlyaccessedcourses/amd/src/main.js
theme/boost/scss/moodle/blocks.scss
theme/boost/style/moodle.css
theme/classic/style/moodle.css

index 54f17c8..9154041 100644 (file)
Binary files a/blocks/recentlyaccessedcourses/amd/build/main.min.js and b/blocks/recentlyaccessedcourses/amd/build/main.min.js differ
index 7d74c0f..c2da9f5 100644 (file)
Binary files a/blocks/recentlyaccessedcourses/amd/build/main.min.js.map and b/blocks/recentlyaccessedcourses/amd/build/main.min.js.map differ
index 9af85cb..423eeb0 100644 (file)
@@ -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) {
index 8ca7510..235b190 100644 (file)
@@ -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%;
+            }
         }
     }
 }
index 6420d42..f6335de 100644 (file)
@@ -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 {
index b64067e..ab465e9 100644 (file)
@@ -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 {