From c67d44cc954ccba9451cdc54babd1347f62e71e7 Mon Sep 17 00:00:00 2001 From: Alexander Bias <alexander.bias@uni-ulm.de> Date: Tue, 17 Nov 2020 16:01:29 +0100 Subject: [PATCH] Bugfix: Dashboard columns do not collapse correctly when blockcolumnwidthdashboard != blockcolumnwidth. --- CHANGES.md | 4 ++++ scss/post.scss | 57 +++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 49 insertions(+), 12 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7aea38f..518a65b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,10 @@ moodle-theme_boost_campus Changes ------- +### Unreleased + +* 2020-11-17 - Bugfix: Dashboard columns did not collapse correctly when blockcolumnwidthdashboard != blockcolumnwidth. + ### Release v3.9-r1 * 2020-09-30 - Adjusted settings.php due to upstream changes in theme Boost settings. diff --git a/scss/post.scss b/scss/post.scss index c74af7d..51a41a8 100644 --- a/scss/post.scss +++ b/scss/post.scss @@ -19,24 +19,57 @@ display: block; } } - } -} -[data-region="blocks-column"] { - width: $blocks-column-width; - @include media-breakpoint-down(md) { - width: 100%; + [data-region="blocks-column"] { + width: $blocks-column-width; + @include media-breakpoint-down(md) { + width: 100%; + } + } } } -/* Change the block column width if setting 'blockcolumnwidthdashboard' is different from setting 'blockcolumnwidth'. */ +/* Change the block column width on the Dashboard if setting 'blockcolumnwidthdashboard' is different from setting 'blockcolumnwidth'. */ @if variable-exists(blockcolumnwidthdashboard) and variable-exists(blockcolumnwidth) { @if $blockcolumnwidthdashboard != $blockcolumnwidth { - #page-my-index [data-region="blocks-column"] { - width: $blocks-column-width-dashboard; + /* Distinguish again if setting 'breakpoint' is active. + This if-construction has duplicated code by purpose for the sake of readability. */ + @if variable-exists(breakpoint) and $breakpoint == 'yes' { + #page-my-index #region-main-settings-menu.has-blocks, + #page-my-index #region-main.has-blocks { + display: inline-block; + width: calc(100% - #{$blocks-plus-gutter-dashboard}); + @include media-breakpoint-down(md) { + width: 100%; + /* MDL-63102 - Remove extra space at bottom. + If modifying make sure block-region is horizontally stacked when in full screen */ + display: block; + } + } + #page-my-index [data-region="blocks-column"] { + width: $blocks-column-width-dashboard; + @include media-breakpoint-down(md) { + width: 100%; + } + } } - #page-my-index #region-main-settings-menu.has-blocks, - #page-my-index #region-main.has-blocks { - width: calc(100% - #{$blocks-plus-gutter-dashboard}); + @else { + #page-my-index #region-main-settings-menu.has-blocks, + #page-my-index #region-main.has-blocks { + display: inline-block; + width: calc(100% - #{$blocks-plus-gutter-dashboard}); + @include media-breakpoint-down(lg) { + width: 100%; + /* MDL-63102 - Remove extra space at bottom. + If modifying make sure block-region is horizontally stacked when in full screen */ + display: block; + } + } + #page-my-index [data-region="blocks-column"] { + width: $blocks-column-width-dashboard; + @include media-breakpoint-down(lg) { + width: 100%; + } + } } } } -- GitLab