summaryrefslogtreecommitdiff
path: root/themes/default/jquery/jquery.ui.init.js
diff options
context:
space:
mode:
authorChad Kieffer <chad@2tbsp.com>2008-11-28 22:02:46 +0000
committerChad Kieffer <chad@2tbsp.com>2008-11-28 22:02:46 +0000
commitbb8fa3c4171d18c0ebe85920aefab09cc6e7f474 (patch)
treebc92e90cbc462761763483d655b4aa3610d3c539 /themes/default/jquery/jquery.ui.init.js
parent4c2d4abb1cf349f4e58c9c8dd7d74284d7bba6c7 (diff)
Dynamically reset the dimensions of resized photos to fit if they're too wide.
Diffstat (limited to 'themes/default/jquery/jquery.ui.init.js')
-rw-r--r--themes/default/jquery/jquery.ui.init.js27
1 files changed, 17 insertions, 10 deletions
diff --git a/themes/default/jquery/jquery.ui.init.js b/themes/default/jquery/jquery.ui.init.js
index e9da2203..5c159137 100644
--- a/themes/default/jquery/jquery.ui.init.js
+++ b/themes/default/jquery/jquery.ui.init.js
@@ -1,18 +1,25 @@
/**
- * Apply jQuery UI components
+ * Initialize UI elements
*
* @todo Write helpers to grab all jQuery UI components by class and initialize
*/
-$(function(){
+$("document").ready(function() {
- //accordion
- $('#gSettingsGroup-1').accordion({
- header: ".ui-accordion-header",
- clearStyle: true
- });
-
- //tabs
- $('#gSettings ul').tabs();
+ /**
+ * Reset width of sized photos wider than their
+ * parent container so that they fit
+ */
+ if ($("#gItem").innerWidth()) {
+ var containerWidth = $("#gItem").innerWidth();
+ 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());
+ }
+ }
});