Properties
$imageDiv
#
MAX_BLOWUP_FACTORstatic
#
Maximum blowup factor tolerated
Properties:
| Name | Type | Description |
|---|---|---|
MAX_BLOWUP_FACTOR |
number |
- Source:
Methods
attach()
#
Registers listeners.
Fires:
- Source:
empty()
#
Clears everything.
- Source:
getCurrentImageWidths() → {ThumbnailWidth}
#
getDimensions() → {Object}
#
Returns width and height of the canvas area (i.e. the space available for the image).
Returns:
Width and height in CSS pixels
- Type
- Object
- Source:
getLightboxImageWidths(image) → {ThumbnailWidth}
#
Gets the widths for a given lightbox image.
Parameters:
| Name | Type | Description |
|---|---|---|
image |
LightboxImage |
Returns:
- Type
- ThumbnailWidth
- Source:
handleDialogEvent(e)
#
Handles a "dialog open/close" event from dialogs on the page.
Parameters:
| Name | Type | Description |
|---|---|---|
e |
jQuery.Event |
- Source:
maybeDisplayPlaceholder(size, $imagePlaceholder, imageWidths)
#
Sets page thumbnail for display if blowupFactor <= MAX_BLOWUP_FACTOR. Otherwise thumb is not set. We set SVG files to the maximum screen size available. Assumes set function called before.
Parameters:
| Name | Type | Description |
|---|---|---|
size |
Object | |
$imagePlaceholder |
jQuery | Image placeholder to be displayed while the real image loads. |
imageWidths |
ThumbnailWidth |
- Source:
Sets page thumbnail for display if blowupFactor <= MAX_BLOWUP_FACTOR.
set(imageRawMetadata, $imageElement)
#
Sets image on the canvas; does not resize it to fit. This is used to make the placeholder image available; it will be resized and displayed by #maybeDisplayPlaceholder(). FIXME maybeDisplayPlaceholder() receives the placeholder so it is very unclear why this is necessary at all (apart from setting the LightboxImage, which is used in size calculations).
Parameters:
| Name | Type | Description |
|---|---|---|
imageRawMetadata |
LightboxImage | |
$imageElement |
jQuery |
- Source:
setImageAndMaxDimensions(thumbnail, imageElement, imageWidths)
#
Resizes image to the given dimensions and displays it on the canvas. This is used to display the actual image; it assumes set function was already called before.
Parameters:
| Name | Type | Description |
|---|---|---|
thumbnail |
Thumbnail | thumbnail information |
imageElement |
HTMLImageElement | |
imageWidths |
ThumbnailWidth |
- Source:
setUpImageClick()
#
Registers click listener on the image.
Fires:
- ReuseDialog#event:mmv-reuse-opened
- ReuseDialog#event:mmv-reuse-closed
- DownloadDialog#event:mmv-download-opened
- DownloadDialog#event:mmv-download-closed
- Source:
showError(error)
#
Displays a message and error icon when loading the image fails.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
string | error message |
- Source:
unattach()
#
Clears listeners.
- Source: