Merge pull request #1108 from Mintoo200/patch-1
Fix event sent before state update
This commit is contained in:
commit
d3ce8dec41
|
|
@ -1023,6 +1023,9 @@ var tarteaucitron = {
|
||||||
tarteaucitron.sendEvent(key + '_loaded');
|
tarteaucitron.sendEvent(key + '_loaded');
|
||||||
}
|
}
|
||||||
var itemStatusElem = document.getElementById('tacCurrentStatus'+key);
|
var itemStatusElem = document.getElementById('tacCurrentStatus'+key);
|
||||||
|
tarteaucitron.state[key] = status;
|
||||||
|
tarteaucitron.cookie.create(key, status);
|
||||||
|
tarteaucitron.userInterface.color(key, status);
|
||||||
if (status == true) {
|
if (status == true) {
|
||||||
itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
|
itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
|
||||||
tarteaucitron.sendEvent(key + '_allowed');
|
tarteaucitron.sendEvent(key + '_allowed');
|
||||||
|
|
@ -1030,9 +1033,6 @@ var tarteaucitron = {
|
||||||
itemStatusElem.innerHTML = tarteaucitron.lang.disallowed;
|
itemStatusElem.innerHTML = tarteaucitron.lang.disallowed;
|
||||||
tarteaucitron.sendEvent(key + '_disallowed');
|
tarteaucitron.sendEvent(key + '_disallowed');
|
||||||
}
|
}
|
||||||
tarteaucitron.state[key] = status;
|
|
||||||
tarteaucitron.cookie.create(key, status);
|
|
||||||
tarteaucitron.userInterface.color(key, status);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -1071,6 +1071,9 @@ var tarteaucitron = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var itemStatusElem = document.getElementById('tacCurrentStatus'+key);
|
var itemStatusElem = document.getElementById('tacCurrentStatus'+key);
|
||||||
|
tarteaucitron.state[key] = status;
|
||||||
|
tarteaucitron.cookie.create(key, status);
|
||||||
|
tarteaucitron.userInterface.color(key, status);
|
||||||
if (status == true) {
|
if (status == true) {
|
||||||
itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
|
itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
|
||||||
tarteaucitron.sendEvent(key + '_allowed');
|
tarteaucitron.sendEvent(key + '_allowed');
|
||||||
|
|
@ -1078,9 +1081,6 @@ var tarteaucitron = {
|
||||||
itemStatusElem.innerHTML = tarteaucitron.lang.disallowed;
|
itemStatusElem.innerHTML = tarteaucitron.lang.disallowed;
|
||||||
tarteaucitron.sendEvent(key + '_disallowed');
|
tarteaucitron.sendEvent(key + '_disallowed');
|
||||||
}
|
}
|
||||||
tarteaucitron.state[key] = status;
|
|
||||||
tarteaucitron.cookie.create(key, status);
|
|
||||||
tarteaucitron.userInterface.color(key, status);
|
|
||||||
},
|
},
|
||||||
"color": function (key, status) {
|
"color": function (key, status) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue