The collaboration event handler (deprecated)

The collaboration function overrides the default UI feedback behavior when multiple people work on the same view at the same time. In addition, any custom collaboration event fired during a collaboration session is delivered to the collaboration function, as the default behavior does not handle any custom collaboration events.

Usage

In most cases you do not need to use the collaboration event handler, as the default behavior is sufficient. If this event handler is not defined, by default, the DOM element is highlighted. Use this function only when you need additional code to propagate changes made by a user to another user's browser or if you want to code your own feedback behavior for the user interface.
Restriction: The collaboration function is not available for Coaches that are running outside of Heritage Process Portal.

To include the default collaboration behavior in your own collaboration(event) logic, you can invoke the super-class collaboration logic inside your collaboration(event) function by using the syntax: this.constructor.prototype.collaboration.apply(this, [event]);

To fire a custom collaboration event, use this.context.triggerCollaboration(). For more information, see The coach view context object.

event object

The function takes a single event object that passes information about a payload to a collaborating user's view. To override the default framework behavior, use event.type == 'custom'.
Table 1. Properties of the event object
Property Type Description
type String Valid values are "focus" | "blur" | "dataChange" | "custom"

Each event type has its own set of properties described in Table 2.

domId String Indicates the dom node with which this collaboration event is associated. For example, on a focus event, domId indicates the dom node that has gained focus in another user's browser.
outlineColor String Only exists for focus events. Indicates the color to highlight the node.
color String The foreground color of the hover area
bgColor String The background color of the hover area
message String A message string associated with this event
userName String The name of the collaborator who triggered this collaboration event. For example, the user who changed data.
payload String User defined data that is used with the custom event. This property is only used in the custom event.
Each event type has a different set of properties, which are described in the following table:
Table 2. Properties of event types
Event type Properties
focus type, domId, outlineColor, color, bgColor, message
blur type, domId
dataChange type, domId, color, bgColor, message, userName, value
custom type, payload
The Tab stock control uses a custom collaboration event. This stock control creates a tab and an area into which you can drop content. Each element that you add results in a new tab and content area. When two people are using the view at the same time, and one user makes a change such as clicking a tab, the change is reflected in the second user's view. To see how this is done, look at the collaboration event in the Tab stock control.