Image

Image

Class that reactively updates the image of an img element whenever the state of its owner changes.

Constructor

new Image(owner, element, options)

Source:
Parameters:
Name Type Description
owner Ripe The Ripe instance to be shown.
element Object The img element that should be updated.
options Object An object with options to configure the image, such as: - 'showInitials' - A Boolean indicating if the owner's personalization should be shown (defaults to 'true¨). - 'initialsBuilder' - A function that receives the initials and engraving as Strings and the img element that will be used and returns a map with the initials and a profile list. - 'frame' - The Ripe instance frame to display (defaults to '0'). - 'size' - The image size in pixels (defaults to '1000'). - 'width' - The image width in pixels (defaults to 'null', meaning it will fallback to 'size'). - 'height' - The image height in pixels (defaults to 'null', meaning it will fallback to 'size'). - 'crop' - A Boolean indicating if it is to crop the image composition.

Methods

cancel(options)

This function is called (by the owner) whenever the current operation in the child should be canceled this way an Image is not updated.
Source:
Parameters:
Name Type Description
options Object Set of optional parameters to adjust the Image.

deinit()

The Image deinitializer, to be called (by the owner) when it should stop responding to updates so that any necessary cleanup operations can be executed.
Source:

init()

The Image initializer, which is called (by the owner) whenever the Image is going to become active. Sets the various values for the Image taking into owner's default values.
Source:

setFrame(frame, options)

Updates the frame that the Image is referring to.
Source:
Parameters:
Name Type Description
frame String The Ripe instance frame to display.
options Object An object with options to configure the setting of the frame.

setInitialsBuilder(builder, options)

Updates the Image's 'initialsBuilder' function.
Source:
Parameters:
Name Type Description
builder function The new 'initialsBuilder' function to be used by the Image.
options Object An object with options to configure the setting of the 'initialsBuilder'.

update(state, options)

This function is called (by the owner) whenever its state changes so that the Image can update itself for the new state.
Source:
Parameters:
Name Type Description
state Object An object containing the new state of the owner.
options Object Set of optional parameters to adjust the Image.