parent
eff726c6f4
commit
ce283c28fd
@ -1,8 +1,7 @@
|
||||
//= require jquery
|
||||
//= require js-cookie/src/js.cookie
|
||||
//= require shepherd.js/dist/js/shepherd
|
||||
|
||||
$(document).on('turbolinks:before-cache', function() {
|
||||
// Remove visible product tours
|
||||
$(".shepherd-step").remove();
|
||||
document.addEventListener('turbolinks:before-cache', function() {
|
||||
// Remove visible product tours
|
||||
document.querySelectorAll(".shepherd-element").forEach(function(el) { el.remove() });
|
||||
});
|
||||
|
@ -2,13 +2,11 @@
|
||||
var tour = new Shepherd.Tour(<%= Rails.configuration.abraham.tour_options.html_safe unless Rails.configuration.abraham.tour_options.nil? %>);
|
||||
|
||||
tour.on("complete", function() {
|
||||
// ajax
|
||||
return $.ajax({
|
||||
url: "/abraham_histories/",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify({
|
||||
// Make AJAX call to save history of tour completion
|
||||
return fetch("/abraham_histories/", {
|
||||
method: "POST",
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
authenticity_token: '<%= form_authenticity_token %>',
|
||||
controller_name: '<%= controller_name %>',
|
||||
action_name: '<%= action_name %>',
|
||||
|
@ -2,7 +2,6 @@
|
||||
"name": "abraham",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"jquery": "^3.4.0",
|
||||
"js-cookie": "^2.2.0",
|
||||
"shepherd.js": "^6.0.0-beta"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user