Reload the page if at least 1 service are disabled

This commit is contained in:
Amauri CHAMPEAUX 2015-03-10 01:56:44 +01:00
parent af2c8e8600
commit e7072fe419
1 changed files with 16 additions and 3 deletions

View File

@ -21,6 +21,7 @@ var tarteaucitron = {
"launch": [],
"parameters": {},
"isAjax": false,
"reloadThePage": false,
"init": function (params) {
"use strict";
var origOpen;
@ -448,6 +449,9 @@ var tarteaucitron = {
service = s[tarteaucitron.job[index]];
key = service.key;
if (tarteaucitron.state[key] !== status) {
if (status === false) {
tarteaucitron.reloadThePage = true;
}
if (tarteaucitron.launch[key] !== true && status === true) {
tarteaucitron.launch[key] = true;
tarteaucitron.services[key].js();
@ -466,6 +470,10 @@ var tarteaucitron = {
if (tarteaucitron.state[key] === status) {
return;
}
if (status === false) {
tarteaucitron.reloadThePage = true;
}
// if not already launched... launch the service
if (status === true) {
@ -558,13 +566,18 @@ var tarteaucitron = {
},
"closePanel": function () {
"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) {
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 () {
"use strict";