-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Triggering custom event through script not working #70
Comments
Hi, did you manage to solve this issue ? I'm having the same issue... |
Even though the docs say
Hope that helps |
jagers it right about the code only run with 2 case ('next' and 'skip') in trigger event. I came up with the solutions add custom case to trigger event and run to next step with nextStep() function. that.trigger = function (event_name) { Hope this help. |
Still experience this issue. Any way to jump to a specific step based on trigger? |
I've got custom steps working in this fork: https://github.com/darron1217/enjoyhint.js |
As far as skipping to a specific step give me until tomorrow and I can post the changes I had to make on the project I'm working on. It requires some specific changes to the rerunscript function |
Any update on skipping to a specific step? |
My pull request #103 |
Awesome thank you. I see it hasn't been merged into xbsoftware/enjoyhint. Is there a repo I can pull to get these latest changes? |
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:
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
andshowNext
are boolean variables set to false.This is how I am triggering custom events on some event:
enjoyhint_instance.trigger('my-custom-event1');
The text was updated successfully, but these errors were encountered: