1

I am setting up a LinkedIn tour for the website. http://linkedin.github.io/hopscotch/ It is working fine. But I need to change the text of a done button. Once I put the following line i18n.doneBtn, the static page comes up but dynamic execution stops and tour does not appear. Would you have any suggestions on how to fix it? Thanks!

       "fnInitComplete": function (){
        $('#accessModal').modal('show');
        {% if request.user.indTutorial %}

            // Define the tour!
        var tour = {
          id: "hello-hopscotch-1",
          steps: [
            {        
              title: "View the Momentum Rankings",
              content: "Algorithms analyze millions of data points to find the fastest growing companies in any industry.",
              target: "tag-page-title",
              width: 450,
              placement: "bottom",
              showCloseButton: true
            },
            {       
              title: "See momentum scores",
              content: "Click on a company to understand the factors that drive their score.",
              //target: "allResultTable",
              target: document.querySelector(".sorting_1"),
              placement: "bottom",
              showCloseButton: true,
              showPrevButton: true,
              width: 450,
              // the title of the done button - next
              i18n.doneBtn: "Next"
            }
          ],

          onEnd: function() {
            window.location.href = '/company/' + $('.my-row').attr('id');
          }
        };
Óscar López
  • 232,561
  • 37
  • 312
  • 386
Vladimir
  • 335
  • 1
  • 7
  • 24

1 Answers1

3

The i18n property is supposed to be an object, and it's supposed to be at the top level of your tour.

It should look something like this:

var tour = {
  id: "hello-hopscotch-1",
  steps: [
    {        
      title: "View the Momentum Rankings",
      content: "Algorithms analyze millions of data points to find the fastest growing companies in any industry.",
      target: "tag-page-title",
      width: 450,
      placement: "bottom",
      showCloseButton: true
    },
    {       
      title: "See momentum scores",
      content: "Click on a company to understand the factors that drive their score.",
      //target: "allResultTable",
      target: document.querySelector(".sorting_1"),
      placement: "bottom",
      showCloseButton: true,
      showPrevButton: true,
      width: 450,
    }
  ],

  onEnd: function() {
    window.location.href = '/company/' + $('.my-row').attr('id');
  },

  i18n: {
    // the title of the done button - next
    doneBtn: "Next"
  }
};
Gordon
  • 46
  • 1