Reload the page if at least 1 service are disabled
This commit is contained in:
parent
af2c8e8600
commit
e7072fe419
|
|
@ -21,6 +21,7 @@ var tarteaucitron = {
|
||||||
"launch": [],
|
"launch": [],
|
||||||
"parameters": {},
|
"parameters": {},
|
||||||
"isAjax": false,
|
"isAjax": false,
|
||||||
|
"reloadThePage": false,
|
||||||
"init": function (params) {
|
"init": function (params) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var origOpen;
|
var origOpen;
|
||||||
|
|
@ -448,6 +449,9 @@ var tarteaucitron = {
|
||||||
service = s[tarteaucitron.job[index]];
|
service = s[tarteaucitron.job[index]];
|
||||||
key = service.key;
|
key = service.key;
|
||||||
if (tarteaucitron.state[key] !== status) {
|
if (tarteaucitron.state[key] !== status) {
|
||||||
|
if (status === false) {
|
||||||
|
tarteaucitron.reloadThePage = true;
|
||||||
|
}
|
||||||
if (tarteaucitron.launch[key] !== true && status === true) {
|
if (tarteaucitron.launch[key] !== true && status === true) {
|
||||||
tarteaucitron.launch[key] = true;
|
tarteaucitron.launch[key] = true;
|
||||||
tarteaucitron.services[key].js();
|
tarteaucitron.services[key].js();
|
||||||
|
|
@ -466,6 +470,10 @@ var tarteaucitron = {
|
||||||
if (tarteaucitron.state[key] === status) {
|
if (tarteaucitron.state[key] === status) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (status === false) {
|
||||||
|
tarteaucitron.reloadThePage = true;
|
||||||
|
}
|
||||||
|
|
||||||
// if not already launched... launch the service
|
// if not already launched... launch the service
|
||||||
if (status === true) {
|
if (status === true) {
|
||||||
|
|
@ -558,13 +566,18 @@ var tarteaucitron = {
|
||||||
},
|
},
|
||||||
"closePanel": function () {
|
"closePanel": function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
|
|
||||||
tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
|
|
||||||
tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');
|
|
||||||
|
|
||||||
if (document.location.hash === tarteaucitron.hashtag) {
|
if (document.location.hash === tarteaucitron.hashtag) {
|
||||||
document.location.hash = '';
|
document.location.hash = '';
|
||||||
}
|
}
|
||||||
|
tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
|
||||||
|
tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');
|
||||||
|
|
||||||
|
if (tarteaucitron.reloadThePage === true) {
|
||||||
|
window.location.reload();
|
||||||
|
} else {
|
||||||
|
tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"openAlert": function () {
|
"openAlert": function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue