Readonly
contextReadonly
hasReadonly
hasWhether to intercept the original event and show a confirmation dialog
The interval ID for the periodic pinging
The interval duration for the ping event
Optional
lastThe last action button that triggered the event
Readonly
reloadReload buttons in the sessions' popups
Readonly
unsavedThe checkbox input to indicate unsaved changes
Readonly
wThe confirmation dialog for overwriting changes made by another user
Static
blessingsStatic
outletsStatic
targetsStatic
valuesButtons that will be intercepted to show the confirmation dialog.
Defaults to submit buttons and workflow action buttons in the edit form.
Static
shouldSet the interval for the periodic pinging, clearing the previous interval if it exists.
Clear the interval for the periodic pinging if one is set.
Proceed with the original action after the user confirms the dialog.
Dispatch the visibility state of the document. When used as an event
listener for the visibilitychange
event, it will dispatch two separate
events: identifier:visible
and identifier:hidden
, which makes it easier
to attach event listeners to specific visibility states.
Dispatch a ping event, to be used by other controllers to keep the session alive or indicate presence.
Conditionally set whether the reload button should immediately reload or show the "unsaved changes" dialog based on the unsaved changes state.
The reload button to update
Sets the unsaved changes input state based on the event type dispatched by the w-unsaved controller. If the event type is w-unsaved:add, the input is checked. If the event type is w-unsaved:clear, the input is unchecked.
w-unsaved:add or w-unsaved:clear
Intercept the original event and show a confirmation dialog instead.
The interception can be controlled dynamically via the interceptValue
so that we can temporarily disable it when the user confirms the overwrite
and immediately re-enable it without having to remove and re-add the event
listener. This is useful for events that are triggered by a multi-step
process, such as a workflow action, which may have its own dialogs and may
be cancelled in the middle of the process.
The original event that triggered the action.
Update the session state with the latest data from the server.
an event that contains JSON data in the detail
property. Normally a w-swap:json
event.
Static
after
Manage an editing session by indicating the presence of the user and handling cases when there are multiple users editing the same content.
This controller defines the following behaviors:
Ideally this controller should be used in conjunction with
SwapController
,ActionController
, andDialogController
to compose the user experience.Example