Permalink
Browse files

Added hide fancy zoom box if click on document that is not inside fan…

…cy zoom box.
  • Loading branch information...
1 parent 0a1361a commit d6f3acef51171df9696265952bd10f980c670605 @jnunemaker committed Sep 4, 2008
Showing with 7 additions and 0 deletions.
  1. +7 −0 prototype/js/fancyzoom.js
@@ -201,4 +201,11 @@ var FancyZoom = Class.create({
this.element.observe('click', FancyZoomBox.show);
}
}
+});
+
+// hide zoom if click fired is not inside zoom
+$$('html').first().observe('click', function(e) {
+ if (typeof(e.findElement('div#zoom')) == 'undefined') {
+ FancyZoomBox.hide(e);
+ }
});

0 comments on commit d6f3ace

Please sign in to comment.