From f5f9ec2f168060e0157e6feb23e5fc5d62393811 Mon Sep 17 00:00:00 2001 From: Ere Maijala Date: Fri, 3 Jan 2025 18:02:17 +0200 Subject: [PATCH 1/2] Remove useless and invalid pagination color overrides. (#4177) - The settings were not needed because the default is already $primary. - The settings in bootstrap5 variables.scss were invalid as $brand-primary (a BS3 thing) isn't actually defined (but !default masked the mistake). --- themes/bootstrap3/less/variables.less | 6 ------ themes/bootstrap3/scss/variables.scss | 6 ------ themes/bootstrap5/scss/bootstrap-variable-overrides.scss | 3 --- themes/bootstrap5/scss/variables.scss | 6 ------ 4 files changed, 21 deletions(-) diff --git a/themes/bootstrap3/less/variables.less b/themes/bootstrap3/less/variables.less index 4addae00bad..e576b1af09b 100644 --- a/themes/bootstrap3/less/variables.less +++ b/themes/bootstrap3/less/variables.less @@ -2,9 +2,6 @@ // Cookie consent dialog should have a z-index low enough to stay below dropdowns and modals @zindex-cookie-consent: (@zindex-dropdown - 10); -@pagination-active-bg: @brand-primary; -@pagination-active-border: @brand-primary; - // Variables used in Sidebar Menu Lists @myresearch-menu-ul-margin-bottom: 0; @myresearch-menu-ul-padding-left: 0; @@ -13,9 +10,6 @@ // Cookie consent dialog should have a z-index low enough to stay below dropdowns and modals $zindex-cookie-consent: (@zindex-dropdown - 10) !default; -$pagination-active-bg: @brand-primary !default; -$pagination-active-border: @brand-primary !default; - $myresearch-menu-ul-margin-bottom: 0 !default; $myresearch-menu-ul-padding-left: 0 !default; <#SCSS */ diff --git a/themes/bootstrap3/scss/variables.scss b/themes/bootstrap3/scss/variables.scss index 4f455148ab3..9d99261e48d 100644 --- a/themes/bootstrap3/scss/variables.scss +++ b/themes/bootstrap3/scss/variables.scss @@ -2,9 +2,6 @@ // Cookie consent dialog should have a z-index low enough to stay below dropdowns and modals $zindex-cookie-consent: ($zindex-dropdown - 10); -$pagination-active-bg: $brand-primary; -$pagination-active-border: $brand-primary; - // Variables used in Sidebar Menu Lists $myresearch-menu-ul-margin-bottom: 0; $myresearch-menu-ul-padding-left: 0; @@ -13,9 +10,6 @@ $myresearch-menu-ul-padding-left: 0; // Cookie consent dialog should have a z-index low enough to stay below dropdowns and modals $zindex-cookie-consent: ($zindex-dropdown - 10) !default; -$pagination-active-bg: $brand-primary !default; -$pagination-active-border: $brand-primary !default; - $myresearch-menu-ul-margin-bottom: 0 !default; $myresearch-menu-ul-padding-left: 0 !default; /* <#SCSS */ diff --git a/themes/bootstrap5/scss/bootstrap-variable-overrides.scss b/themes/bootstrap5/scss/bootstrap-variable-overrides.scss index e2d44e64806..a99cb6a0c4e 100644 --- a/themes/bootstrap5/scss/bootstrap-variable-overrides.scss +++ b/themes/bootstrap5/scss/bootstrap-variable-overrides.scss @@ -47,9 +47,6 @@ $form-switch-bg-image-dark: none !default; $navbar-dark-toggler-icon-bg: none !default; $navbar-light-toggler-icon-bg: none !default; -$pagination-active-bg: $primary !default; -$pagination-active-border: $primary !default; - $link-hover-decoration: underline !default; $icon-link-underline-offset: inherit !default; diff --git a/themes/bootstrap5/scss/variables.scss b/themes/bootstrap5/scss/variables.scss index 4f455148ab3..9d99261e48d 100644 --- a/themes/bootstrap5/scss/variables.scss +++ b/themes/bootstrap5/scss/variables.scss @@ -2,9 +2,6 @@ // Cookie consent dialog should have a z-index low enough to stay below dropdowns and modals $zindex-cookie-consent: ($zindex-dropdown - 10); -$pagination-active-bg: $brand-primary; -$pagination-active-border: $brand-primary; - // Variables used in Sidebar Menu Lists $myresearch-menu-ul-margin-bottom: 0; $myresearch-menu-ul-padding-left: 0; @@ -13,9 +10,6 @@ $myresearch-menu-ul-padding-left: 0; // Cookie consent dialog should have a z-index low enough to stay below dropdowns and modals $zindex-cookie-consent: ($zindex-dropdown - 10) !default; -$pagination-active-bg: $brand-primary !default; -$pagination-active-border: $brand-primary !default; - $myresearch-menu-ul-margin-bottom: 0 !default; $myresearch-menu-ul-padding-left: 0 !default; /* <#SCSS */ From a3300c5e2d032b9ea9a8badbfcfeb17bfc882dc5 Mon Sep 17 00:00:00 2001 From: Ere Maijala Date: Sun, 5 Jan 2025 14:04:54 +0200 Subject: [PATCH 2/2] Apply BS3 data attribute mappings to added child elements too. (#4176) Improved Bootstrap 3 compatibility layer to handle dynamically added content better by converting data attributes for child nodes of the added nodes as well. --- themes/bootstrap5/js/bs3-compat.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/themes/bootstrap5/js/bs3-compat.js b/themes/bootstrap5/js/bs3-compat.js index e7db85b5a66..c2c36b2021d 100644 --- a/themes/bootstrap5/js/bs3-compat.js +++ b/themes/bootstrap5/js/bs3-compat.js @@ -1,5 +1,6 @@ /*global VuFind*/ VuFind.register('bootstrap3CompatibilityLayer', function bootstrap3CompatibilityLayer() { + const data_attribute_selector = '[data-dismiss],[data-target],[data-toggle],[data-ride],[data-slide],[data-slide-to]'; function initNavbar() { document.querySelectorAll('.navbar').forEach((el) => { @@ -114,13 +115,14 @@ VuFind.register('bootstrap3CompatibilityLayer', function bootstrap3Compatibility } function initDataAttributeMappings() { - document.querySelectorAll('[data-dismiss],[data-target],[data-toggle],[data-ride],[data-slide],[data-slide-to]').forEach((el) => { - convertDataAttributes(el); - }); + document.querySelectorAll(data_attribute_selector).forEach((el) => convertDataAttributes(el)); const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { mutation.addedNodes.forEach((el) => { convertDataAttributes(el); + if (typeof el.querySelectorAll !== 'undefined') { + el.querySelectorAll(data_attribute_selector).forEach((subEl) => convertDataAttributes(subEl)); + } }); }); });