Update picture viewer.
[wolnelektury.git] / apps / wolnelektury_core / static / js / base.js
index 7db29ab..9ba5631 100755 (executable)
                                        } 
                                });
                        });
+                   /* this kinda breaks the whole page. */
                        $('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'))
+                                       if (p.hasClass('hidden-box-trigger') 
+                                           || p.hasClass('simple-toggler'))
                                                return;
                                        p = p.parent();
                                }
@@ -130,6 +132,19 @@ $('#themes-list-toggle').click(function(event) {
        $(function(){
            $("#search").search();});
 
+      $('body').on('click', '.simple-toggler' , function(ev) {
+       ev.preventDefault();
+       var scope = $(this).closest('.simple-toggler-scope');
+       scope.find('.simple-hidden-box').each(function(){ 
+         var $this = $(this);
+         if ($this.is(':hidden')) {
+           $this.show();
+         } else { 
+           $this.hide();
+         }
+         });
+      });
+
     });
 })(jQuery);