diff options
author | Chad Kieffer <ckieffer@gmail.com> | 2009-08-11 00:15:04 -0600 |
---|---|---|
committer | Chad Kieffer <ckieffer@gmail.com> | 2009-08-11 00:15:04 -0600 |
commit | 3e3bbd5d2e71419109eaecc0677962e9efa0b59a (patch) | |
tree | d0b42bdfdf5127194043b92f72dc113ce516e180 /lib | |
parent | e3a58b76c14c64a5254f4efd73730866818bd0b3 (diff) | |
parent | cbba45fffc7368280e9529f55e108d0080175b6a (diff) |
Merge branch 'master' of git@github.com:bharat/gallery3
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gallery.ajax.js | 15 | ||||
-rw-r--r-- | lib/gallery.common.js | 8 |
2 files changed, 21 insertions, 2 deletions
diff --git a/lib/gallery.ajax.js b/lib/gallery.ajax.js new file mode 100644 index 00000000..4f26745d --- /dev/null +++ b/lib/gallery.ajax.js @@ -0,0 +1,15 @@ +(function($) { + $.widget("ui.gallery_ajax", { + _init: function() { + this.element.click(function(event) { + eval("var ajax_handler = " + $(event.currentTarget).attr("ajax_handler")); + $.get($(event.currentTarget).attr("href"), function(data) { + eval("var data = " + data); + ajax_handler(data); + }); + event.preventDefault(); + return false; + }); + } + }); +})(jQuery); diff --git a/lib/gallery.common.js b/lib/gallery.common.js index eea0fada..317a73e7 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -80,7 +80,7 @@ return this.id.match(/gPhotoId-\d+/); }); return photo; - } + }; /** * Get the sum of an element's height, margin-top, and margin-bottom @@ -104,7 +104,11 @@ $(this).removeClass("ui-state-hover"); } ); - } + }; + // 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}); + }; })(jQuery); |