mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-21 03:49:21 -04:00
26 lines
631 B
JavaScript
26 lines
631 B
JavaScript
/**
|
|
* Initialize UI elements
|
|
*
|
|
* @todo Write helpers to grab all jQuery UI components by class and initialize
|
|
*/
|
|
|
|
$("document").ready(function() {
|
|
|
|
/**
|
|
* Reset width of sized photos wider than their
|
|
* parent container so that they fit
|
|
*/
|
|
if ($("#gItem").length) {
|
|
var containerWidth = $("#gItem").width();
|
|
var oPhoto = $("#gItem img").filter(function() {
|
|
return this.id.match(/gPhotoID-/);
|
|
})
|
|
if (containerWidth < oPhoto.width()) {
|
|
var proportion = containerWidth / oPhoto.width();
|
|
oPhoto.width(containerWidth);
|
|
oPhoto.height(proportion * oPhoto.height());
|
|
}
|
|
}
|
|
|
|
});
|