Properties
image
#
Properties:
Name | Type | Description |
---|---|---|
Image |
ImageModel
|
null
|
the download button currently points to. |
Methods
attach()
#
Registers listeners.
createDownloadButton($container)
#
Creates download split button. It is a link with the "download" property set plus an arrow that allows the user to select the image size desired. The "download" property triggers native browser downloading in browsers that support it. The fallback is the 'download' parameter which instructs the server to send the right headers so the browser downloads the file instead of just displaying it. If all this fails, the image will appear in another window/tab.
Parameters:
Name | Type | Description |
---|---|---|
$container |
jQuery |
createDownloadSection($container)
#
createPreviewLink($container)
#
createSizePulldownMenu($container)
#
empty()
#
getExtensionFromUrl(url) → {string}
#
Chops off the extension part of an URL.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | URL |
Returns:
Extension
- Type
- string
handleSizeSwitch()
#
Handles size menu change events.
selectAttribution([name])
#
Selects the specified attribution type.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
string |
optional |
'plain' | The attribution type to use ('plain' or 'html') |
set(image)
#
setAttributionText(imageInfo)
#
Sets the text in the attribution input element.
Parameters:
Name | Type | Description |
---|---|---|
imageInfo |
ImageModel |
setDownloadUrl(url)
#
Sets the URL on the download button.
Parameters:
Name | Type | Description |
---|---|---|
url |
string |
unattach()
#
Clears listeners.