Skip to content

Commit f4e1cd1

Browse files
authored
Merge pull request #1401 from Cruiser13/master
feat: add an option to show the title on the top/bottom
2 parents 03f46f8 + a7d3db3 commit f4e1cd1

5 files changed

Lines changed: 20 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ tarteaucitron.init({
4141
"serviceDefaultState": "wait", /* Default state (true - wait - false) */
4242
4343
"showAlertSmall": false, /* Show the small banner on bottom right */
44+
"showTitleBanner": false, /* Also show the title (middleBarHead) on the top/bottom banners */
4445
"cookieslist": false, /* Show the cookie list in a mini banner */
4546
"cookieslistEmbed": false, /* Show the cookie list on the control panel */
4647

‎css/tarteaucitron.css‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,17 @@ span.tarteaucitronTitle.tarteaucitronH3 {
13421342
/* custom title for popup and middle banner */
13431343
#tarteaucitronRoot.tarteaucitronSize-middle #tarteaucitronAlertBig::before, #tarteaucitronRoot.tarteaucitronSize-popup #tarteaucitronAlertBig::before {content: var(--tacTitleBanner);}
13441344

1345+
/* opt-in: also show the title banner on the top/bottom bars (showTitleBanner parameter) */
1346+
#tarteaucitronRoot.tarteaucitronTitleBanner.tarteaucitronSize-bottom #tarteaucitronAlertBig::before,
1347+
#tarteaucitronRoot.tarteaucitronTitleBanner.tarteaucitronSize-top #tarteaucitronAlertBig::before {
1348+
content: var(--tacTitleBanner);
1349+
display: block;
1350+
text-align: left;
1351+
font-size: 18px;
1352+
padding: 0 10px;
1353+
margin-bottom: 8px;
1354+
}
1355+
13451356
/* middle banner */
13461357
div#tarteaucitronRoot.tarteaucitronSize-middle.tarteaucitronBeforeVisible:before {content: '';position: fixed;width: 100%;height: 100%;background: white;top: 0;left: 0;z-index: 100000;opacity: 0.5;}
13471358
body #tarteaucitronRoot.tarteaucitronSize-middle div#tarteaucitronAlertBig {width: 60%;min-width: 285px;height: fit-content;margin: auto;top:0;left:0;bottom:0;right:0;box-shadow: 0 0 9000px #000;border-radius: 20px;padding: 35px 25px;}

‎css/tarteaucitron.min.css‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tarteaucitron.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ var tarteaucitron = {
227227
"bodyPosition": "bottom",
228228
"removeCredit": false,
229229
"showAlertSmall": false,
230+
"showTitleBanner": false,
230231
"showDetailsOnClick": true,
231232
"showIcon": true,
232233
"iconPosition": "BottomRight",
@@ -840,6 +841,11 @@ var tarteaucitron = {
840841

841842
tarteaucitron.userInterface.addClass("tarteaucitronRoot", "tarteaucitronSize-" + tarteaucitron.parameters.orientation);
842843

844+
// optionally show the title banner (middleBarHead) on the top/bottom bars too
845+
if (tarteaucitron.parameters.showTitleBanner === true) {
846+
tarteaucitron.userInterface.addClass("tarteaucitronRoot", "tarteaucitronTitleBanner");
847+
}
848+
843849
div.setAttribute('data-nosnippet', 'true');
844850
div.setAttribute('lang', language);
845851
div.setAttribute('role', 'region');

‎tarteaucitron.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)