summaryrefslogtreecommitdiff
path: root/themes/wind/js/ui.init.js
diff options
context:
space:
mode:
Diffstat (limited to 'themes/wind/js/ui.init.js')
-rw-r--r--themes/wind/js/ui.init.js40
1 files changed, 12 insertions, 28 deletions
diff --git a/themes/wind/js/ui.init.js b/themes/wind/js/ui.init.js
index 4eee1bb2..abf79b81 100644
--- a/themes/wind/js/ui.init.js
+++ b/themes/wind/js/ui.init.js
@@ -65,34 +65,19 @@ $(document).ready(function() {
// Initialize thumbnail hover effect
$(".gItem").hover(
function() {
- // Insert invisible placeholder to hold the item's position in the grid
- var placeHolder = $(this).clone();
- $(placeHolder).attr("id", "gPlaceHolder");
- $(placeHolder).css("visibility", "hidden");
+ // Insert a placeholder to hold the item's position in the grid
+ var placeHolder = $(this).clone().attr("id", "gPlaceHolder");
$(this).after($(placeHolder));
- // Style and position the item
- $(this).addClass("gHoverItem");
+ // Style and position the hover item
var position = $(this).position();
- $(this).css("position", "absolute");
- $(this).css("top", position.top);
- $(this).css("left", position.left);
- $(this).css("z-index", "1000");
+ $(this).css("top", position.top).css("left", position.left);
+ $(this).addClass("gHoverItem");
// Initialize the contextual menu
$(this).gallery_context_menu();
- // Set height based on height of descendents
- var title = $(this).find("h2");
- var meta = $(this).find(".gMetadata");
- var item_ht = $(this).height();
- var title_ht = $(title).gallery_height();
- var meta_ht = $(meta).gallery_height();
- var ht = item_ht + title_ht + meta_ht;
- var context_label = $(this).find(".gContextMenu li:first");
- var css_id = $(this).attr("id");
- if ($("#" + css_id + " .gContextMenu li").length) {
- var context_label_ht = $(context_label).gallery_height();
- ht = ht + context_label_ht;
- }
- $(this).height(ht);
+ $(this).height("auto");
+ var context_menu = $(this).find(".gContextMenu");
+ var adj_height = $(this).height() + context_menu.height();
+ $(this).height(adj_height);
},
function() {
// Reset item height, position, and z-index
@@ -104,14 +89,13 @@ $(document).ready(function() {
if ($.browser.msie && $.browser.version >= 8) {
sib_height = sib_height + 1;
}
+ $(this).toggleClass("gHoverItem");
$(this).css("height", sib_height);
$(this).css("position", "relative");
- $(this).css("top", 0);
- $(this).css("left", 0);
- $(this).css("z-index", 1);
+ $(this).css("top", 0).css("left", 0);
// Remove the placeholder and hover class from the item
- $("#gPlaceHolder").remove();
$(this).removeClass("gHoverItem");
+ $("#gPlaceHolder").remove();
}
);
}