2008-11-21 01:56:33 +00:00
|
|
|
/**
|
2008-11-28 22:02:46 +00:00
|
|
|
* Initialize UI elements
|
2008-11-21 01:56:33 +00:00
|
|
|
*
|
|
|
|
|
* @todo Write helpers to grab all jQuery UI components by class and initialize
|
|
|
|
|
*/
|
|
|
|
|
|
2008-11-28 22:02:46 +00:00
|
|
|
$("document").ready(function() {
|
2008-11-21 01:56:33 +00:00
|
|
|
|
2008-11-28 22:02:46 +00:00
|
|
|
/**
|
|
|
|
|
* Reset width of sized photos wider than their
|
|
|
|
|
* parent container so that they fit
|
|
|
|
|
*/
|
2008-12-05 05:59:50 +00:00
|
|
|
if ($("#gItem").length) {
|
2008-11-28 23:24:13 +00:00
|
|
|
var containerWidth = $("#gItem").width();
|
2008-11-28 22:02:46 +00:00
|
|
|
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());
|
|
|
|
|
}
|
|
|
|
|
}
|
2008-11-21 01:56:33 +00:00
|
|
|
|
|
|
|
|
});
|