Related Previews¶
Info
This plugin is an evolution of indoor
plugin. It can creates and tracks multiple previews,
for related views, not just "indoor"
related view.
This plugin tracks related plugin for an related views. If the tracked related views exist, it creates an interface elements with the preview of that related view. If the related view is loaded, the preview will change to go back to the original view.
- Plugin name:
"related_previews"
- Plugin namespace:
"related_previews"
Info
Since version 3d-viewer@1.5.0
this plugin is always loaded.
Dependencies¶
This plugin has the following dependencies (they will be downloaded automatically):
- related plugin.
Loading the plugin¶
Features¶
If this plugin is loaded, the module will have the following additional features:
Triggers¶
This plugin adds the following new callback triggers, additionally to the default ones:
click_related_preview
: Will be called when the user clicks the related preview. The first parameter will be a default callback object with an additional property calledrelated_previews
with the following content:venue_id
(string): venue id of the related view.view_id
(string): view id of the related view.
Methods¶
generateRelatedPreview¶
It starts tracking related previews with the input id. If it exists, it will be displayed.
Input:
id
(string): Related view id to be tracked and to generate interface.
getTrackedPreviewIds¶
Returns a list with all tracked related ids.
Output:
related_previews
(string[]): list of ids being tracked with generateRelatedPreview.
showPreview¶
Shows the preview with the input id, if it exists.
id
(string): Related view id to show its interface.
hidePreview¶
Hides the preview with the input id, if it exists.
id
(string): Related view id to be hide its interface.
showTitle¶
Shows the title of the preview with the input id, if it exists.
id
(string): Related view id to show its title.
hideTitle¶
Hides the title of the preview with the input id, if it exists.
id
(string): Related view id to hide its interface.
Flags¶
enabled¶
enables or disables the related previews.
Example
automatic_load¶
When a preview is clicked, the destination will be loaded automatically, and click_related_preview
won't be
triggered.
Info
This flag is enabled by default if you DIDN'T specify this plugin at instancing time, but is disabled if you did.
Example
automatic_track¶
If this flag is enabled, the related
views that match the regex /^(indoor|related_\d+)$/
will be automatically
tracked without the need of calling generateRelatedPreview
method.
Info
This flag is enabled by default if you DIDN'T specify this plugin at instancing time, but is disabled if you did.