more dynamic popups, compatibility fixes
[wolnelektury.git] / wolnelektury / static / js / base.js
index 8225a1f..d8d31b3 100755 (executable)
                                        } 
                                });
                        });
+                       $('body').click(function(e) {
+                               if ($current == null) return;
+                               var p = $(e.target);
+                               while (p.length) {
+                                       if (p == $current)
+                                               return;
+                                       if (p.hasClass('hidden-box-trigger'))
+                                               return;
+                                       p = p.parent();
+                               }
+                               $current.hide('fast');
+                               $current = null;
+                       });
                })();
+