Big banner modification

- close if all services have been reviewed
- possibility to choose the orientation (top or bottom)
This commit is contained in:
Amauri CHAMPEAUX 2014-12-02 23:30:09 +01:00
parent 13e51f0f7e
commit d741956491
2 changed files with 23 additions and 7 deletions

View File

@ -250,6 +250,14 @@
/*** /***
* Big alert * Big alert
*/ */
.tarteaucitronAlertBigTop {
top: 0;
}
.tarteaucitronAlertBigBottom {
bottom: 0;
}
#tarteaucitronAlertBig { #tarteaucitronAlertBig {
background: #333; background: #333;
color: #fff !important; color: #fff !important;
@ -259,7 +267,6 @@
padding: 5px 5%; padding: 5px 5%;
position: fixed; position: fixed;
text-align: center; text-align: center;
top: 0;
width: 90%; width: 90%;
box-sizing: content-box; box-sizing: content-box;
z-index: 2147483645; z-index: 2147483645;

View File

@ -23,6 +23,7 @@ var tarteaucitron = {
"autoOpen": false, "autoOpen": false,
"grayArea": false, "grayArea": false,
"highPrivacy": false, "highPrivacy": false,
"orientation": "top",
"showAlertSmall": true "showAlertSmall": true
}; };
@ -56,7 +57,8 @@ var tarteaucitron = {
html = '', html = '',
lastTitle, lastTitle,
alert = false, alert = false,
index; index,
orientation = 'Top';
// dedup, clean and sort job[] // dedup, clean and sort job[]
function cleanArray(arr) { function cleanArray(arr) {
@ -161,8 +163,13 @@ var tarteaucitron = {
html += ' </div>'; html += ' </div>';
html += '</div>'; html += '</div>';
// get the banner orientation
if (default.orientation === 'bottom') {
orientation = 'Bottom';
}
if (defaults.highPrivacy) { if (defaults.highPrivacy) {
html += '<div id="tarteaucitronAlertBig">'; html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
html += ' <span id="tarteaucitronDisclaimerAlert">'; html += ' <span id="tarteaucitronDisclaimerAlert">';
html += ' ' + tarteaucitron.lang.alertBigPrivacy; html += ' ' + tarteaucitron.lang.alertBigPrivacy;
html += ' </span>'; html += ' </span>';
@ -171,7 +178,7 @@ var tarteaucitron = {
html += ' </span>'; html += ' </span>';
html += '</div>'; html += '</div>';
} else { } else {
html += '<div id="tarteaucitronAlertBig">'; html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
html += ' <span id="tarteaucitronDisclaimerAlert">'; html += ' <span id="tarteaucitronDisclaimerAlert">';
html += ' ' + tarteaucitron.lang.alertBig; html += ' ' + tarteaucitron.lang.alertBig;
html += ' </span>'; html += ' </span>';
@ -272,8 +279,6 @@ var tarteaucitron = {
tarteaucitron.state[key] = status; tarteaucitron.state[key] = status;
tarteaucitron.cookie.create(key, status); tarteaucitron.cookie.create(key, status);
tarteaucitron.userInterface.color(key, status); tarteaucitron.userInterface.color(key, status);
tarteaucitron.userInterface.closeAlert();
} }
}, },
"respond": function (el, status) { "respond": function (el, status) {
@ -346,12 +351,16 @@ var tarteaucitron = {
tarteaucitron.userInterface.css(c + 'AllAllowed', 'backgroundColor', gray); tarteaucitron.userInterface.css(c + 'AllAllowed', 'backgroundColor', gray);
tarteaucitron.userInterface.css(c + 'AllDenied', 'backgroundColor', gray); tarteaucitron.userInterface.css(c + 'AllDenied', 'backgroundColor', gray);
} }
// close the alert if all service have been reviewed
if (nbPending === 0) {
tarteaucitron.userInterface.closeAlert();
}
}, },
"openPanel": function () { "openPanel": function () {
"use strict"; "use strict";
tarteaucitron.userInterface.css('tarteaucitron', 'display', 'block'); tarteaucitron.userInterface.css('tarteaucitron', 'display', 'block');
tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block'); tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
tarteaucitron.userInterface.closeAlert();
// setting hash tag // setting hash tag
document.location.hash = 'tarteaucitron'; document.location.hash = 'tarteaucitron';