summaryrefslogtreecommitdiff
path: root/themes/default/js/ui.init.js
diff options
context:
space:
mode:
authorChad Kieffer <chad@2tbsp.com>2008-12-28 07:33:09 +0000
committerChad Kieffer <chad@2tbsp.com>2008-12-28 07:33:09 +0000
commitaff2af5e1f23d713255ab03820656fa936230550 (patch)
treefde1f5c41ff965c8a46ceb142c908f7ce665b94c /themes/default/js/ui.init.js
parentdc62e4167e989e9c3f29c83baf7e1c11f21dc484 (diff)
Tighten up album grid display. Vertically align thumbnail/metadata in gItem container. Brought back borders. Use a neutral bg color for albums. Link item titles, not just thumbnails.
Diffstat (limited to 'themes/default/js/ui.init.js')
-rw-r--r--themes/default/js/ui.init.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js
index fe650539..cb9fa07c 100644
--- a/themes/default/js/ui.init.js
+++ b/themes/default/js/ui.init.js
@@ -3,6 +3,12 @@
*/
$("document").ready(function() {
+ // Vertical align thumbnails/metadata in album grid
+ if ($(".gItem").length) {
+ $(".gItem").wrapInner("<div></div>")
+ $('.gItem div').vAlign();
+ }
+
// Apply modal dialog class
$(".gMenuLink").addClass("gDialogLink");
$("#gLoginLink").addClass("gDialogLink");
@@ -75,6 +81,16 @@ $("document").ready(function() {
});
+// Vertically align a block element's content
+$.fn.vAlign = function() {
+ return this.each(function(i){
+ var ah = $(this).height();
+ var ph = $(this).parent().height();
+ var mh = (ph - ah) / 2;
+ $(this).css('margin-top', mh);
+ });
+};
+
/**
* Fire openDialog() and prevent links from opening
*