Class: PopupComponent
component.PopupComponent
classdesc
Component for showing HTML popup objects.
The add
method is used for adding new popups. Popups are removed by reference.
It is not possible to update popups in the set by updating any properties directly on the popup object. Popups need to be replaced by removing them and creating new ones with relevant changed properties and adding those instead.
Popups are only relevant to a single image because they are based on 2D basic image coordinates. Popups related to a certain image should be removed when the viewer is moved to another image.
To retrive and use the popup component
example
var viewer = new Viewer({ component: { popup: true }, ... });
var popupComponent = viewer.getComponent("popup");
#
HierarchyComponent
<ComponentConfiguration
>↳
PopupComponent
#
Properties#
componentNameâ–ª Static
componentName: ComponentName
= "popup"
#
Overrides#
Defined incomponent/popup/PopupComponent.ts:54
#
Accessors#
activated• get
activated(): boolean
Get activated.
#
Returnsboolean
Value indicating if the component is currently active.
#
Defined in#
defaultConfiguration• get
defaultConfiguration(): TConfiguration
Get default configuration.
#
ReturnsTConfiguration
Default configuration for component.
#
Defined in#
name• get
name(): string
Get name.
description
The name of the component. Used when interacting with the
component through the Viewer's API.
#
Returnsstring
#
Defined in#
Methods#
addâ–¸ add(popups
): void
Add popups to the popups set.
description
Adding a new popup never replaces an old one
because they are stored by reference. Adding an already
existing popup has no effect.
example
popupComponent.add([popup1, popup2]);
#
ParametersName | Type | Description |
---|---|---|
popups | Popup [] | Popups to add. |
#
Returnsvoid
#
Defined incomponent/popup/PopupComponent.ts:94
#
configureâ–¸ configure(configuration
): void
Configure the component.
#
ParametersName | Type | Description |
---|---|---|
configuration | ComponentConfiguration | Component configuration. |
#
Returnsvoid
#
Inherited from#
Defined in#
fireâ–¸ fire<T
>(type
, event
): void
#
Type parametersName |
---|
T |
#
ParametersName | Type |
---|---|
type | ComponentEventType |
event | T |
#
Returnsvoid
#
Inherited from#
Defined in#
getAllâ–¸ getAll(): Popup
[]
Returns an array of all popups.
example
var popups = popupComponent.getAll();
#
ReturnsPopup
[]
#
Defined incomponent/popup/PopupComponent.ts:119
#
offâ–¸ off<T
>(type
, handler
): void
Unsubscribe from an event by its name.
#
Type parametersName |
---|
T |
#
ParametersName | Type | Description |
---|---|---|
type | ComponentEventType | The name of the event to unsubscribe from. |
handler | (event : T ) => void | The handler to remove. |
#
Returnsvoid
#
Inherited from#
Defined in#
onâ–¸ on<T
>(type
, handler
): void
Subscribe to an event by its name.
#
Type parametersName |
---|
T |
#
ParametersName | Type | Description |
---|---|---|
type | ComponentEventType | The name of the event to subscribe to. |
handler | (event : T ) => void | The handler called when the event occurs. |
#
Returnsvoid
#
Inherited from#
Defined in#
removeâ–¸ remove(popups
): void
Remove popups based on reference from the popup set.
example
popupComponent.remove([popup1, popup2]);
#
ParametersName | Type | Description |
---|---|---|
popups | Popup [] | Popups to remove. |
#
Returnsvoid
#
Defined incomponent/popup/PopupComponent.ts:133
#
removeAllâ–¸ removeAll(): void
Remove all popups from the popup set.
example
popupComponent.removeAll();
#
Returnsvoid