Labs64 / GuideChimp

Create interactive guided product tours in minutes with the most non-technical friendly, lightweight and extendable library.

Home Page:https://www.labs64.com/guidechimp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JavaScript events plugin doesn't work (v3.x)

r-brown opened this issue · comments

Object "fromStep" at the first step in the version(> 3.0) instead of an empty object will be null. So you need to check formStep for null.

Change example:
from

guideChimp.on('onBeforeChange', (to, from)=>{
  document.getElementById('log').innerHTML = 'log: ' + from.title + ' -> ' + to.title;
});

to

guideChimp.on('onBeforeChange', (to, from)=>{
  var fromTitle = (from) ? from.title : undefined;
  var toTitle = to.title;
  
  document.getElementById('log').innerHTML = 'log: ' + fromTitle + ' -> ' + toTitle;
});