mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-15 11:59:56 +00:00
24 lines
502 B
JavaScript
24 lines
502 B
JavaScript
'use strict';
|
|
|
|
(function($, vignette) {
|
|
var infoboxImages = $('.portable-infobox-image');
|
|
|
|
/**
|
|
* @desc loads infobox image image
|
|
* @param {number} index - array index
|
|
* @param {string} img - img html
|
|
*/
|
|
function loadImage(index, img) {
|
|
var $img = $(img),
|
|
url = $img.data('url'),
|
|
options = {
|
|
mode: vignette.mode.scaleToWidth,
|
|
width: $img.parent().width()
|
|
};
|
|
|
|
$img.attr('src', vignette.getThumbURL(url, options));
|
|
}
|
|
|
|
infoboxImages.each(loadImage);
|
|
})(jQuery, Vignette);
|