|
@@ -641,6 +641,18 @@ var tarteaucitron = {
|
|
document.getElementById(id).style[property] = value;
|
|
document.getElementById(id).style[property] = value;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ "addClass": function (id, className) {
|
|
|
|
+ "use strict";
|
|
|
|
+ if (document.getElementById(id) !== null) {
|
|
|
|
+ document.getElementById(id).classList.add(className);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ "removeClass": function (id, className) {
|
|
|
|
+ "use strict";
|
|
|
|
+ if (document.getElementById(id) !== null) {
|
|
|
|
+ document.getElementById(id).classList.remove(className);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
"respondAll": function (status) {
|
|
"respondAll": function (status) {
|
|
"use strict";
|
|
"use strict";
|
|
var s = tarteaucitron.services,
|
|
var s = tarteaucitron.services,
|
|
@@ -728,14 +740,23 @@ var tarteaucitron = {
|
|
tarteaucitron.userInterface.css(c + 'DotRed', 'width', ((100 / sum) * nbDenied) + '%');
|
|
tarteaucitron.userInterface.css(c + 'DotRed', 'width', ((100 / sum) * nbDenied) + '%');
|
|
|
|
|
|
if (nbDenied === 0 && nbPending === 0) {
|
|
if (nbDenied === 0 && nbPending === 0) {
|
|
- document.getElementById(c + 'AllDenied').classList.remove('tarteaucitronIsSelected');
|
|
|
|
- document.getElementById(c + 'AllAllowed').classList.add('tarteaucitronIsSelected');
|
|
|
|
|
|
+ tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected');
|
|
|
|
+ tarteaucitron.userInterface.addClass(c + 'AllAllowed', c + 'IsSelected');
|
|
|
|
+
|
|
|
|
+ tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsAllowed');
|
|
|
|
+ tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied');
|
|
} else if (nbAllowed === 0 && nbPending === 0) {
|
|
} else if (nbAllowed === 0 && nbPending === 0) {
|
|
- document.getElementById(c + 'AllAllowed').classList.remove('tarteaucitronIsSelected');
|
|
|
|
- document.getElementById(c + 'AllDenied').classList.add('tarteaucitronIsSelected');
|
|
|
|
|
|
+ tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected');
|
|
|
|
+ tarteaucitron.userInterface.addClass(c + 'AllDenied', c + 'IsSelected');
|
|
|
|
+
|
|
|
|
+ tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed');
|
|
|
|
+ tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsDenied');
|
|
} else {
|
|
} else {
|
|
- document.getElementById(c + 'AllDenied').classList.remove('tarteaucitronIsSelected');
|
|
|
|
- document.getElementById(c + 'AllAllowed').classList.remove('tarteaucitronIsSelected');
|
|
|
|
|
|
+ tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected');
|
|
|
|
+ tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected');
|
|
|
|
+
|
|
|
|
+ tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed');
|
|
|
|
+ tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied');
|
|
}
|
|
}
|
|
|
|
|
|
// close the alert if all service have been reviewed
|
|
// close the alert if all service have been reviewed
|