summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-09-10 08:41:12 -0700
committerBharat Mediratta <bharat@menalto.com>2010-09-10 08:41:12 -0700
commit3936183446375e039cc35eec80e427849336c210 (patch)
tree5983bea3adbf355a117224eeecc1d668cac1de75 /lib
parentd698a19e0e9acdcb81c5245d1f681546b604a1f3 (diff)
parent6e62d604a45b9bf1a60d04effb7eb08e7d15463c (diff)
Merge branch 'master' of github.com:gallery/gallery3
Diffstat (limited to 'lib')
-rw-r--r--lib/gallery.common.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/gallery.common.js b/lib/gallery.common.js
index 69452f39..548b2e7c 100644
--- a/lib/gallery.common.js
+++ b/lib/gallery.common.js
@@ -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;
@@ -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