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:
parent
5bf835b965
commit
57965973dc
6 changed files with 326 additions and 348 deletions
17
bookwyrm/static/js/guided_tour.js
Normal file
17
bookwyrm/static/js/guided_tour.js
Normal 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',
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue