new mw.widgets.MediaResultWidget(configopt)
#
Creates an mw.widgets.MediaResultWidget object.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object |
<optional> |
Configuration options Properties
|
Extends
Methods
calculateSizing(originalDimensions, boundingBoxopt)
#
Resize the thumbnail and wrapper according to row height and bounding boxes, if given.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
originalDimensions |
Object | Original image dimensions with width and height values |
|
boundingBox |
Object |
<optional> |
Specific bounding box, if supplied |
calculateWrapperPadding(thumbDimensions) → {Object}
#
Adjust the wrapper padding for small images.
Parameters:
Name | Type | Description |
---|---|---|
thumbDimensions |
Object | Thumbnail dimensions |
Returns:
Css styling for the wrapper
- Type
- Object
getDimensions() → {Object}
#
Retrieve the store dimensions object.
Returns:
Thumb dimensions
- Type
- Object
getRow() → {number}
#
Get the row this result is in.
Returns:
row Row number
- Type
- number
getRowHeight() → {number}
#
Set the row height for all size calculations.
Returns:
rowHeight Row height
- Type
- number
hasSrc() → {boolean}
#
Check if the image has a src attribute already.
Returns:
Thumbnail has its source attribute set
- Type
- boolean
lazyLoad()
#
Replace the empty .src attribute of the image with the actual src.
Replace the empty .src attribute of the image with the actual src.
onThumbnailError()
#
onThumbnailLoad()
#
resizeThumb(resizeFactor)
#
Resize thumbnail and element according to the resize factor.
Parameters:
Name | Type | Description |
---|---|---|
resizeFactor |
number | The resizing factor for the image |
setRow(row)
#
Set the row this result is in.
Parameters:
Name | Type | Description |
---|---|---|
row |
number | Row number |
setRowHeight(rowHeight)
#
Set the row height for all size calculations.
Parameters:
Name | Type | Description |
---|---|---|
rowHeight |
number | Row height |