Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gallery/gallery3
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat committed Sep 10, 2010
2 parents d698a19 + 6e62d60 commit 3936183
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
16 changes: 9 additions & 7 deletions lib/gallery.common.js
Expand Up @@ -24,8 +24,12 @@
if (container == null) {
container = 'div';
}
$(this).html("<" + container + " class=\"g-valign\">" + $(this).html() + "</" + container + ">");
var el = $(this).children(container + ".g-valign");
var el = $(this).find(".g-valign");
if (!el.length) {
$(this).html("<" + container + " class=\"g-valign\">" + $(this).html() +
"</" + container + ">");
el = $(this).children(container + ".g-valign");
}
var elh = $(el).height();
var ph = $(this).height();
var nh = (ph - elh) / 2;
Expand Down Expand Up @@ -119,11 +123,9 @@
};

// Ajax handler for replacing an image, used in Ajax thumbnail rotation
$.gallery_replace_image = function(data, thumb) {
$(thumb).attr({src: data.src, width: data.width, height: data.height});
if (typeof gallery_image_replaced_hook == 'function') {
gallery_image_replaced_hook(data, thumb);
}
$.gallery_replace_image = function(data, img_selector) {
$(img_selector).attr({src: data.src, width: data.width, height: data.height});
$(img_selector).trigger("gallery.change");
};

// Initialize context menus
Expand Down
Binary file modified modules/organize/lib/Gallery3WebClient.swf
Binary file not shown.
7 changes: 7 additions & 0 deletions themes/wind/js/ui.init.js
Expand Up @@ -90,9 +90,16 @@ $(document).ready(function() {
$(this).css("top", 0).css("left", 0);
// Remove the placeholder and hover class from the item
$(this).removeClass("g-hover-item");
$(this).gallery_valign();
$("#g-place-holder").remove();
}
);

// Realign any thumbnails that change so that when we rotate a thumb it stays centered.
$(".g-item").bind("gallery.change", function() {
$(this).height($(this).find("img").height() + 2);
$(".g-item").equal_heights().gallery_valign();
});
}

// Photo/Item item view
Expand Down
4 changes: 2 additions & 2 deletions themes/wind/views/photo.html.php
Expand Up @@ -12,15 +12,15 @@

// After the image is rotated or replaced we have to reload the image dimensions
// so that the full size view isn't distorted.
gallery_image_replaced_hook = function(data, thumb) {
$("#g-photo").bind("gallery.change", function() {
$.ajax({
url: "<?= url::site("items/dimensions/" . $theme->item()->id) ?>",
dataType: "json",
success: function(data, textStatus) {
full_dims = data.full;
}
});
}
});
});
</script>
<? endif ?>
Expand Down

0 comments on commit 3936183

Please sign in to comment.