diff options
author | Dan Hansen <bbq@joindiaspora.com> | 2011-07-27 07:43:35 +0400 |
---|---|---|
committer | Dan Hansen <bbq@joindiaspora.com> | 2011-07-27 07:43:35 +0400 |
commit | d94f806a50aa505aaff18ed44f3341dad26518d4 (patch) | |
tree | f1ed7e936c2eaca78563de61c69e5057ab58e26b /public | |
parent | ea5db03bdfbdf35405aa023d617f13e82044f15e (diff) |
close the lightbox when a user clicks on the backdrop
Diffstat (limited to 'public')
-rw-r--r-- | public/javascripts/widgets/lightbox.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/public/javascripts/widgets/lightbox.js b/public/javascripts/widgets/lightbox.js index 8b1e7fd6a..409ade1f1 100644 --- a/public/javascripts/widgets/lightbox.js +++ b/public/javascripts/widgets/lightbox.js @@ -43,6 +43,8 @@ jQuery.fn.center = (function() { evt.preventDefault(); self.resetLightbox(); }); + self.backdrop.click(self.resetLightbox); + self.lightbox.click(self.resetLightbox); self.body.keydown(function(evt) { @@ -82,7 +84,7 @@ jQuery.fn.center = (function() { this.lightboxImageClicked = function(evt) { evt.preventDefault(); - + var selectedImage = $(this).find("img.stream-photo"), imageUrl = selectedImage.attr("data-full-photo"), images = selectedImage.parents('.stream_element').find('img.stream-photo'), @@ -110,7 +112,7 @@ jQuery.fn.center = (function() { this.imagesetImageClicked = function(evt) { evt.preventDefault(); - + evt.stopPropagation(); self.selectImage($(this)); }; |