diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss
index b88f1aad05..808854350d 100644
--- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss
+++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss
@@ -4619,10 +4619,12 @@ div .suggestion_note {
/* Cookie consent bar */
#cookieConsentBar {
+ align-items: center;
background: rgba( 0, 0, 0, .7 );
bottom: 0;
color: rgba( 255, 255, 255, .9 );
display: none;
+ flex-wrap: wrap;
left: 0;
padding: 20px;
position: fixed;
@@ -4634,16 +4636,23 @@ div .suggestion_note {
color: #D7EBFF;
}
- #consentButtons {
- margin-top: 10px;
- text-align: right;
- }
+ button {
+ margin-bottom: .5rem;
+ margin-top: .5rem;
- button:not( :last-child ) {
- margin-right: 10px;
+ &:not( :last-child ) {
+ margin-right: 10px;
+ }
}
}
+#consentButtons {
+ flex-grow: 1;
+ margin-top: 10px;
+ text-align: left;
+ white-space: normal;
+}
+
/* Cookie consent modal */
#cookieConsentModal {
.modal-dialog {
@@ -4699,6 +4708,13 @@ div .suggestion_note {
@import "toolbar";
@import "forms";
+@media only screen and ( min-width: 608px ) {
+ #consentButtons {
+ text-align: right;
+ white-space: nowrap;
+ }
+}
+
@media ( max-width: 767px ) {
.header-menu-link {
display: inline-block;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc
index 0ddfa53c96..24572c2a3a 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc
@@ -86,7 +86,7 @@
[% IF ( CookieConsentBar && CookieConsentBar.content && CookieConsentBar.content.count >0 ) %]
-
+
[%- FOREACH item IN CookieConsentBar.content -%]
[%- item.content | $raw -%]
[%- END -%]
@@ -97,7 +97,7 @@
[% END %]
-
+
diff --git a/koha-tmpl/intranet-tmpl/prog/js/cookieconsent.js b/koha-tmpl/intranet-tmpl/prog/js/cookieconsent.js
index 1b6ca51530..40ae180983 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/cookieconsent.js
+++ b/koha-tmpl/intranet-tmpl/prog/js/cookieconsent.js
@@ -40,7 +40,7 @@
consentBar.css('bottom', height);
};
consentBar.attr('aria-hidden', 'false');
- consentBar.show();
+ consentBar.css("display", "flex");
}
function hideConsentBar() {
diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss
index 5685a88fc0..e24fb0773c 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss
+++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss
@@ -276,6 +276,12 @@
margin: 5px 0;
}
}
+
+ }
+
+ #consentButtons {
+ text-align: right;
+ white-space: nowrap;
}
#views {
diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss
index 43a29ba5ad..a3884592c9 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss
+++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss
@@ -2908,10 +2908,12 @@ $star-selected: #EDB867;
/* Cookie consent bar */
#cookieConsentBar {
+ align-items: center;
background: rgba( 0, 0, 0, .7 );
bottom: 0;
color: rgba( 255, 255, 255, .9 );
display: none;
+ flex-wrap: wrap;
left: 0;
padding: 20px;
position: fixed;
@@ -2923,16 +2925,23 @@ $star-selected: #EDB867;
color: #C5ECFF;
}
- #consentButtons {
- margin-top: 10px;
- text-align: right;
- }
+ button {
+ margin-bottom: .5rem;
+ margin-top: .5rem;
- button:not( :last-child ) {
- margin-right: 10px;
+ &:not( :last-child ) {
+ margin-right: 10px;
+ }
}
}
+#consentButtons {
+ flex-grow: 1;
+ margin-top: 10px;
+ text-align: left;
+ white-space: normal;
+}
+
/* Cookie consent modal */
#cookieConsentModal {
.modal-dialog {
@@ -2940,7 +2949,6 @@ $star-selected: #EDB867;
}
.consentModalItem {
- align-items: center;
border: 1px solid #CCC;
border-radius: 5px;
display: flex;
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc
index 19545e277b..682a0656a8 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc
@@ -464,7 +464,9 @@
[% IF ( CookieConsentBar ) %]
- [% PROCESS koha_news_block news => CookieConsentBar %]
+
+ [% PROCESS koha_news_block news => CookieConsentBar %]
+
[% END %]
[% IF ( JSConsents.all('opacConsent').size ) %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/cookieconsent.js b/koha-tmpl/opac-tmpl/bootstrap/js/cookieconsent.js
index 0d44f11140..8ddaad2c13 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/js/cookieconsent.js
+++ b/koha-tmpl/opac-tmpl/bootstrap/js/cookieconsent.js
@@ -27,6 +27,20 @@
initialiseSelected();
});
+ $(window).on("scroll", function() {
+ const consentBar = $("#cookieConsentBar");
+ const langmenu = $("#changelanguage");
+ const wrapper = $("#wrapper");
+ if( langmenu ) {
+ const height = langmenu.height();
+ if( $(window).scrollTop() >= wrapper.offset().top + wrapper.outerHeight() - window.innerHeight ) {
+ consentBar.css("bottom", height);
+ } else {
+ consentBar.css("bottom", 0);
+ }
+ };
+ });
+
// Initialise existing consent based on local storage
function getExistingConsent() {
existingConsent = localStorage.getItem('cookieConsent') ?
@@ -36,13 +50,8 @@
function showConsentBar() {
const consentBar = $('#cookieConsentBar');
- const langmenu = $('#changelanguage');
- if(langmenu) {
- const height = langmenu.height();
- consentBar.css('bottom', height);
- };
consentBar.attr('aria-hidden', 'false');
- consentBar.show();
+ consentBar.css("display", "flex");
}
function hideConsentBar() {