Skip to main content

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");

Hierarchy#

  • Component<ComponentConfiguration>

    ↳ PopupComponent

Properties#

componentName#

â–ª Static componentName: ComponentName = "popup"

Overrides#

Component.componentName

Defined in#

component/popup/PopupComponent.ts:54

Accessors#

activated#

• get activated(): boolean

Get activated.

Returns#

boolean

Value indicating if the component is currently active.

Defined in#

component/Component.ts:78


defaultConfiguration#

• get defaultConfiguration(): TConfiguration

Get default configuration.

Returns#

TConfiguration

Default configuration for component.

Defined in#

component/Component.ts:92


name#

• get name(): string

Get name.

description The name of the component. Used when interacting with the component through the Viewer's API.

Returns#

string

Defined in#

component/Component.ts:107

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]);

Parameters#

NameTypeDescription
popupsPopup[]Popups to add.

Returns#

void

Defined in#

component/popup/PopupComponent.ts:94


configure#

â–¸ configure(configuration): void

Configure the component.

Parameters#

NameTypeDescription
configurationComponentConfigurationComponent configuration.

Returns#

void

Inherited from#

Component.configure

Defined in#

component/Component.ts:131


fire#

â–¸ fire<T>(type, event): void

Type parameters#

Name
T

Parameters#

NameType
typeComponentEventType
eventT

Returns#

void

Inherited from#

Component.fire

Defined in#

component/Component.ts:149


getAll#

â–¸ getAll(): Popup[]

Returns an array of all popups.

example

var popups = popupComponent.getAll();

Returns#

Popup[]

Defined in#

component/popup/PopupComponent.ts:119


off#

â–¸ off<T>(type, handler): void

Unsubscribe from an event by its name.

Type parameters#

Name
T

Parameters#

NameTypeDescription
typeComponentEventTypeThe name of the event to unsubscribe from.
handler(event: T) => voidThe handler to remove.

Returns#

void

Inherited from#

Component.off

Defined in#

component/Component.ts:156


on#

â–¸ on<T>(type, handler): void

Subscribe to an event by its name.

Type parameters#

Name
T

Parameters#

NameTypeDescription
typeComponentEventTypeThe name of the event to subscribe to.
handler(event: T) => voidThe handler called when the event occurs.

Returns#

void

Inherited from#

Component.on

Defined in#

component/Component.ts:163


remove#

â–¸ remove(popups): void

Remove popups based on reference from the popup set.

example

popupComponent.remove([popup1, popup2]);

Parameters#

NameTypeDescription
popupsPopup[]Popups to remove.

Returns#

void

Defined in#

component/popup/PopupComponent.ts:133


removeAll#

â–¸ removeAll(): void

Remove all popups from the popup set.

example

popupComponent.removeAll();

Returns#

void

Defined in#

component/popup/PopupComponent.ts:149