We're running into a situation where we basically want a rule to hit two triggers before processing. I noticed if you look at the arguments variable in a Custom Code function in the Conditions, you can get this object from the first item in the array:
- {
- $rule: {id: "RULE_ID", name: "RULE_NAME"}
- $type: "core.dom-ready"
- element: document
- nativeEvent: Event {isTrusted: true, type: "DOMContentLoaded", target: document, currentTarget: document, eventPhase: 2, …}
- target: document
- }
Which is awesome - that's basically what I wanted to grab so I could keep track of what had already been called. However, I don't know if this is documented, and I want to make sure that I'm not going to use something that could be removed without warning. I know the nativeEvent is provided on the page (if present) as the variable event. This wasn't available for the other condition though, which was a direct call. I know I could get around it in a handwave-y way right now (event being present == dom ready call, event not being present == direct call) but if I really want to get messed up and add a third condition in the future, that won't work anymore.
Any recommended approaches for something like this?
Views
Replies
Total Likes