Description
I have a series of steps (say 5 steps), last two of which are asynchronous. So, I am giving custom event for last two steps. Now, I am not able to trigger the last two steps manually. Also I am getting the 4th step which should not be triggered until triggered manually. Any idea? The error I get after 4th step is rendered is:
Uncaught TypeError: Cannot read property 'left' of undefined
Here is the sample steps config:
var enjoyhint_script_steps = [{ "click #btn1": "Some Instruction.", "showSkip": showSkip, "showNext": showNext }, { "click [name='btn2']": "Some Instruction", "showSkip": showSkip, "showNext": showNext }, { "click .btn3": "Some Instruction", "showSkip": showSkip, "showNext": showNext }, { "event_type": "custom", "event": "my-custom-event1", "selector": "[name='btn4']", "description": "Some thing here", "showSkip": showSkip, "showNext": showNext }, { "event_type": "custom", "event": "my-custom-event2", "selector": "[name='btn5']", "description": "More instructions", "showSkip": showSkip, "showNext": showNext }];
var enjoyhint_instance = new EnjoyHint({});
enjoyhint_instance.set(enjoyhint_script_steps);
enjoyhint_instance.run();
showSkip
and showNext
are boolean variables set to false.
This is how I am triggering custom events on some event:
enjoyhint_instance.trigger('my-custom-event1');