1
0
Fork 0

make guided tour cancel button DRY

Move cancel button function into a separate JS file.
The selector JS for this function cannot be within bookwyrm.js because the guided tour elements load after bookwyrm.js.
This commit is contained in:
Hugh Rundle 2022-06-18 13:27:00 +10:00
parent 5bf835b965
commit 57965973dc
6 changed files with 326 additions and 348 deletions

View file

@ -0,0 +1,17 @@
/**
* Set guided tour user value to False
* @param {csrf_token} string
* @return {undefined}
*/
function disableGuidedTour(csrf_token) {
console.log(csrf_token);
fetch('/guided-tour/False', {
headers: {
'X-CSRFToken': csrf_token,
},
method: 'POST',
redirect: 'follow',
mode: 'same-origin',
})
}