-
Notifications
You must be signed in to change notification settings - Fork 3
Page Launching Control
By default the web page will load javascript without any special instructions. You can however change it to depend on deferred scripts, config, login and user properties.
The page resolver tracks the state and configuration of the page. It is used to decorate the body element so the page can be styled based on the current state.
By default the state is authenticated, authorised, connected, configured.
Since these are set by default the page will be launched without waiting.
If the page connects to a backend for authentication and authorisation and you want to delay the page launching until the connection is established you will need to prevent the default and trigger the launching yourself.
Put the following in your html:
<script>
Resolver("page").set("state.authenticated",false);
Resolver("page").on("change","state.loading",function(ev) {
if (ev.value == false) ev.preventDefault();
});
</script>
And then when the connection is established
Resolver("page").set("state.authenticated",true)
And then when the loaded scripts and configuration is applied
Resolver("page").set("state.configured",true)