You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.
In some circumstances, animations being one of them, we need to delay the requiring of a node until we can be sure that all node properties have been processed and all HTMLElements are correctly laid out. This is especially important in Animations as we need to get access to a nodes dimensions in a lot of cases which may be dependent on the styles applied to parent elements. With the current implementation, the requireNode callback triggers before parents are processed.
We should consider implementing an event based system similar to the way that used in RegistryHandler. The implementation could allow users to register for an event when a given node, or level of nodes has been processed and made available.
For example:
// fires when node with `myKey` is availablenodeHandler.on({type: 'node',key: 'myKey'},callback);// fires when the widget root is availablenodeHandler.on({type: 'widget'},callback);// fires when the projector is availablenodeHandler.on({type: 'projector'},callback);
The benefit of this approach is that in the case of animations, you can wait for the projector to be processed before adding any animations. This ensures that all HTMLElements have been laid out and had styles applied.
nodeHandler.on({type: 'projector'},()=>{constmyAnimatedNode=this.nodes('myKey');// calculate and add animation here});
The text was updated successfully, but these errors were encountered:
tomdye
changed the title
Required Node callbacks fire before all widget node properties are processed
Add eventing system to meta to determine when nodes are processed
Sep 6, 2017
Enhancement
In some circumstances, animations being one of them, we need to delay the requiring of a node until we can be sure that all node properties have been processed and all
HTMLElements
are correctly laid out. This is especially important in Animations as we need to get access to a nodes dimensions in a lot of cases which may be dependent on the styles applied to parent elements. With the current implementation, therequireNode
callback triggers before parents are processed.We should consider implementing an event based system similar to the way that used in
RegistryHandler
. The implementation could allow users to register for an event when a given node, or level of nodes has been processed and made available.For example:
The benefit of this approach is that in the case of animations, you can wait for the projector to be processed before adding any animations. This ensures that all
HTMLElements
have been laid out and had styles applied.The text was updated successfully, but these errors were encountered: