0

I'm confused. I can open the modal using this:

onNext: function() {
   $('#modal').modal('toggle');
}

But I can't close the modal with the same function with another $('#modal').modal('toggle'); or $('#modal').modal('hide').

I even tried creating a registerHelper but it still doesn't.

hopscotch.registerHelper('closeModal', function() {
      $('#modal').modal('toggle');
 });
user3744076
  • 127
  • 6
  • 15

1 Answers1

0

Oops, I made a mistake. I can close the modal using the onEnd setting.

var tour = {
  id: 'tour1',
  steps: [{
            target: 'Target',
            title: 'Target Title',
            content: 'Target Content'
         }
         ],
         onEnd: ["closeModal"]
}

Made a callback helper to close the modals.

hopscotch.registerHelper('closeModal', function() {
      $('.modal').modal('hide');
});
user3744076
  • 127
  • 6
  • 15