Skip to content

Commit

Permalink
Fix timeout on the save button
Browse files Browse the repository at this point in the history
  • Loading branch information
AmauriC committed Feb 29, 2024
1 parent 31c23ec commit b689111
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tarteaucitron.js
Original file line number Diff line number Diff line change
Expand Up @@ -923,11 +923,13 @@ var tarteaucitron = {
});
tarteaucitron.addClickEventToId("tarteaucitronSaveButton", function () {
tarteaucitron.job.forEach(function(id) {
var timeoutSaveButton = 0;
if (tarteaucitron.state[id] !== true) {
timeoutSaveButton = 500;
tarteaucitron.setConsent(id, false);
}
setTimeout(tarteaucitron.userInterface.closePanel, 500);
});
setTimeout(tarteaucitron.userInterface.closePanel, timeoutSaveButton);
});
var toggleBtns = document.getElementsByClassName("catToggleBtn"), i;
for (i = 0; i < toggleBtns.length; i++) {
Expand Down
2 changes: 1 addition & 1 deletion tarteaucitron.min.js

Large diffs are not rendered by default.

0 comments on commit b689111

Please sign in to comment.