Constructor
new ViewfinderCardView()
- Since:
- Source:
Extends
Members
className
- Source:
templateVars
Values meant to be used by the rendered HTML template.
- Source:
type :string
The type of View this is
Type:
- Source:
Methods
applyImageFallback(img)
Replace a broken hero image with its configured fallback source.
Parameters:
| Name |
Type |
Description |
img |
HTMLImageElement
|
The image element that failed loading. |
- Since:
- Source:
events()
The events this view will listen to and the associated function to call.
- Source:
Dispatch a primary button click to the registered handler for the
action type. Closes any open visualization overlay first.
Parameters:
| Name |
Type |
Description |
e |
MouseEvent
|
The click event from a `.button-primary` element. |
- Source:
initialize(root0)
Initialize with card metadata and action callbacks.
Parameters:
| Name |
Type |
Description |
root0 |
object
|
Initialize options.
Properties
| Name |
Type |
Attributes |
Description |
preset |
ViewfinderCardModel
|
|
Card metadata. |
onMapAction |
function
|
<optional>
|
Handles map actions. |
onIframeAction |
function
|
<optional>
|
Handles iframe actions. |
onRequestCloseVisualization |
function
|
<optional>
|
Closes overlays before actions. |
onActivate |
function
|
<optional>
|
Marks this card as active. |
onActionUiActivated |
function
|
<optional>
|
Notifies UI action activation. |
|
- Source:
render()
Render the view by updating the HTML of the element.
The new HTML is computed from an HTML template that
is passed an object with relevant view state.
- Source:
resetActiveState()
Remove the active state from this card and all its buttons.
- Source:
restoreAction(action) → {boolean}
Restore an action from URL state without replaying click side effects.
Parameters:
- Since:
- Source:
Returns:
True when restoration succeeded.
-
Type
-
boolean
selectLayers(eopt)
Zoom to the card's location and toggle the relevant layers. Closes
any open visualization overlay first. When the clicked button carries
a `data-button-index` attribute it is a 'map'-type button; the
corresponding action object is forwarded to `onMapAction` so the
model can use its specific coordinates and layerIds.
Parameters:
| Name |
Type |
Attributes |
Description |
e |
MouseEvent
|
<optional>
|
The click event, if triggered from the DOM. |
- Source:
setActive(buttonEl, action, optionsopt)
Mark this card as active and highlight the specific clicked button.
Parameters:
| Name |
Type |
Attributes |
Description |
buttonEl |
HTMLElement
|
|
The button element that was activated. |
action |
ViewfinderCardAction
|
|
The action object associated with the button. |
options |
object
|
<optional>
|
Additional activation options.
Properties
| Name |
Type |
Attributes |
Description |
notifyActionActivated |
boolean
|
<optional>
|
Whether to notify listeners. |
|
- Since:
- Source:
wireImageFallbacks()
Wire one-time error handlers for hero images with fallback sources.
- Since:
- Source: