-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Query for events before stateMachineInstance.advance: ```js if (stateMachine) { // Check for events before stateMachine.advance. var fired = stateMachine.firedEventCount(); if (fired != 0) { for (var i = 0; i < fired; i++) { var event = stateMachine.firedEventAt(i); console.log("event", event); if (event.type == 131) { var a = document.createElement("a"); a.setAttribute("href", event.url); a.setAttribute("target", event.target); a.click(); } } } stateMachine.advance(elapsedSeconds); } ``` Details regarding when "target" window works and doesn't in this thread: https://2dimensions.slack.com/archives/CHMAP278R/p1692402507928619 Basics are: - "_blank" works if the event happened in response to a pointer down, it will get pop-up blocked by the browser if you trigger it at the end of an animation/state change. - Use "_self" for opening urls based on time/not click. Diffs= d75d43c73 Events API for WASM (#5850) Co-authored-by: Luigi Rosso <[email protected]>
- Loading branch information
1 parent
079f744
commit d93b18a
Showing
2 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
ad4236501bdf0218046a93c54f2ee4a379747890 | ||
d75d43c73b28e956a3a309757a24e4508a13c495 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters