diff options
Diffstat (limited to 'themes/default')
-rw-r--r-- | themes/default/css/screen.css | 32 | ||||
-rw-r--r-- | themes/default/js/ui.init.js | 72 | ||||
-rw-r--r-- | themes/default/views/movie.html.php | 3 | ||||
-rw-r--r-- | themes/default/views/photo.html.php | 3 |
4 files changed, 45 insertions, 65 deletions
diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index ecae2bb2..d39152e4 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -276,7 +276,7 @@ li.gError select { /* Status messages ~~~~~~~~~~~~~~~~~~~~~~~ */ #gMessage { - width: 99%; + width: 100%; } #gAdminAkismet .gSuccess, @@ -406,7 +406,6 @@ form .gError, } #gSidebar { - background-color: #fff; font-size: .9em; padding: 0 20px; width: 220px; @@ -492,23 +491,13 @@ form .gError, width: 16px; } -#gContent #gAlbumGrid #gHoverItem { +#gContent #gAlbumGrid .gHoverItem { background-color: #fff; border: 1px solid #000; - display: none; - height: auto; - padding: 0; - position: absolute; - width: auto; - z-index: 100; } -#gContent #gAlbumGrid #gHoverItem .gItem { - border: none; -} - -#gContent #gHoverItem .gItem h2, -#gContent #gHoverItem .gItem .gMetadata { +#gContent .gHoverItem h2, +#gContent .gHoverItem .gMetadata { display: block; } @@ -530,6 +519,7 @@ form .gError, #gContent #gComments { margin-top: 2em; + position: relative; } #gContent #gComments ul li { @@ -561,6 +551,12 @@ form .gError, width: 32px; } +#gAddCommentButton { + position: absolute; + right: 0; + top: 2px; +} + #gContent #gAddCommentForm { margin-top: 2em; } @@ -647,15 +643,15 @@ form .gError, line-height: 1.6em; } -#gHoverItem .gContextMenu { +.gHoverItem .gContextMenu { display: block; } -#gHoverItem .gContextMenu li { +.gHoverItem .gContextMenu li { text-align: left; } -#gHoverItem .gContextMenu a:hover { +.gHoverItem .gContextMenu a:hover { text-decoration: none; } diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js index 2391f638..949933e9 100644 --- a/themes/default/js/ui.init.js +++ b/themes/default/js/ui.init.js @@ -62,39 +62,41 @@ $(document).ready(function() { // Initialize context menus $(".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"); + $(this).after($(placeHolder)); + // Style and position the item + $(this).addClass("gHoverItem"); var position = $(this).position(); - var item_classes = $(this).attr("class"); - var bg_color = $(this).css("background-color"); - var container = $(this).parent(); - $("#gHoverItem").remove(); - container.append("<div id=\"gHoverItem\"><div class=\"" + item_classes + "\">" - + $(this).html() + "</div></div>"); - $("#gHoverItem").css("top", position.top); - $("#gHoverItem").css("left", position.left); - $("#gHoverItem").css("background-color", bg_color); - $.fn.gallery_hover_init(); - var v_align = $(this).find(".gValign"); + $(this).css("position", "absolute"); + $(this).css("top", position.top); + $(this).css("left", position.left); + $(this).css("z-index", "1000"); + // 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 context = $(this).find(".gContextMenu"); var context_label = $(this).find(".gContextMenu li:first"); - $("#gHoverItem .gItem").height( - $(v_align).gallery_height() - + $(title).gallery_height() - + $(meta).gallery_height() - + parseInt($(context).css("margin-top").replace("px","")) - + $(context_label).gallery_height() - ); - - $("#gHoverItem").fadeIn("fast"); - $("#gHoverItem").hover( - function(){ - $(this).gallery_context_menu(); - }, - function() { - $(this).hide(); - } - ); + var item_ht = $(this).height(); + var title_ht = $(title).gallery_height(); + var meta_ht = $(meta).gallery_height(); + var context_label_ht = $(context_label).gallery_height(); + $(this).height(item_ht + title_ht + meta_ht + context_label_ht); + }, + function() { + // Reset item height, position, and z-index + var sib_height = $(this).next().height(); + $(this).css("height", sib_height); + $(this).css("position", "relative"); + $(this).css("top", null); + $(this).css("left", null); + $(this).css("z-index", null); + // Remove the placeholder and hover class from the item + $("#gPlaceHolder").remove(); + $(this).removeClass("gHoverItem"); } ); } @@ -110,18 +112,6 @@ $(document).ready(function() { $(this).gallery_context_menu(); }); - // Collapse comments form, insert button to expand - if ($("#gAddCommentForm").length) { - var showCommentForm = '<a href="#add_comment_form"' - + ' class="showCommentForm gButtonLink ui-corner-all ui-icon-left ui-state-default right">' - + '<span class="ui-icon ui-icon-comment"></span>' + ADD_A_COMMENT + '</a>'; - $("#gAddCommentForm").hide(); - $("#gComments").prepend(showCommentForm); - $(".showCommentForm").click(function(){ - $("#gAddCommentForm").show(1000); - }); - } - // Add scroll effect for links to named anchors $.localScroll({ queue: true, diff --git a/themes/default/views/movie.html.php b/themes/default/views/movie.html.php index c8ecd769..29789f8e 100644 --- a/themes/default/views/movie.html.php +++ b/themes/default/views/movie.html.php @@ -32,9 +32,6 @@ <div><?= nl2br(p::purify($item->description)) ?></div> </div> - <script type="text/javascript"> - var ADD_A_COMMENT = "<?= t("Add a comment") ?>"; - </script> <?= $theme->photo_bottom() ?> <?= $theme->context_menu($item, "#gMovieId-{$item->id}") ?> </div> diff --git a/themes/default/views/photo.html.php b/themes/default/views/photo.html.php index fa5def47..39e61ef6 100644 --- a/themes/default/views/photo.html.php +++ b/themes/default/views/photo.html.php @@ -55,8 +55,5 @@ <div><?= nl2br(p::purify($item->description)) ?></div> </div> - <script type="text/javascript"> - var ADD_A_COMMENT = "<?= t("Add a comment") ?>"; - </script> <?= $theme->photo_bottom() ?> </div> |