-
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.
The core library functionality will work regardless of the page state, but some document roles, stateful fields and actions will only become available as the page launches.
If the page connects to a backend for authentication + authorisation, and you want to delay the page launching until the connection and authorisation is established you will need to change the defaults and trigger the launching yourself.
Put the following in your html:
<script>
Resolver("page").set("state.authenticated",false);
</script>
This will hold off the launching while the user is authenticated. And then when the connection is established
Resolver("page").set("state.authenticated",true)
This paradigm is used when you have an asynchronus callback for gradually establishing communication with you backend systems.
If you need authorisation info after login in but before launching set state.authorised to false.
If you need to verify connectivity to the backend set state.connected to false.
And then when the loaded scripts and configuration is applied
Resolver("page").set("state.configured",true)