mw.widgets.MediaResultWidget

Media result widget.

Extends

Constructor

new mw.widgets.MediaResultWidget(config) #

Creates an mw.widgets.MediaResultWidget object.

Parameters:

Name Type Attributes Description
config Object optional

Configuration options

Properties:
Name Type Attributes Description
rowHeight number optional

Height of the row this result is part of

maxRowWidth number optional

A limit for the width of the row this result is a part of.

minWidth number optional

Minimum width for the result

maxWidth number optional

Maximum width for the result

Source:

Methods

calculateSizing(originalDimensions, boundingBox) #

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

Source:
Resize the thumbnail and wrapper according to row height and bounding boxes, if given.

calculateWrapperPadding(thumbDimensions) → {Object} #

Adjust the wrapper padding for small images.

Parameters:

Name Type Description
thumbDimensions Object

Thumbnail dimensions

Source:

Returns:

Css styling for the wrapper

Type
Object
Adjust the wrapper padding for small images.

getDimensions() → {Object} #

Retrieve the store dimensions object.

Source:

Returns:

Thumb dimensions

Type
Object
Retrieve the store dimensions object.

getRow() → {number} #

Get the row this result is in.

Source:

Returns:

row Row number

Type
number
Get the row this result is in.

getRowHeight() → {number} #

Set the row height for all size calculations.

Source:

Returns:

rowHeight Row height

Type
number
Set the row height for all size calculations.

hasSrc() → {boolean} #

Check if the image has a src attribute already.

Source:

Returns:

Thumbnail has its source attribute set

Type
boolean
Check if the image has a src attribute already.

lazyLoad() #

Replace the empty .src attribute of the image with the actual src.

Source:

Replace the empty .src attribute of the image with the actual src.

resizeThumb(resizeFactor) #

Resize thumbnail and element according to the resize factor.

Parameters:

Name Type Description
resizeFactor number

The resizing factor for the image

Source:
Resize thumbnail and element according to the resize factor.

setRow(row) #

Set the row this result is in.

Parameters:

Name Type Description
row number

Row number

Source:
Set the row this result is in.

setRowHeight(rowHeight) #

Set the row height for all size calculations.

Parameters:

Name Type Description
rowHeight number

Row height

Source:
Set the row height for all size calculations.