5b3b3f0727d5f3e4a387a123da38e53fc9662a83
[wolnelektury.git] / apps / funding / static / funding / funding.js
1 $(function() {
2     $('.funding .close').click(function(e) {\r
3         e.preventDefault();
4         var fundNode = $(e.target).parent();\r
5         fundNode.slideUp(function(){fundingHandle.show()});
6         if(Modernizr.localstorage)
7             localStorage['hide-offer-id'] = fundNode.attr('data-offer-id');\r
8     });
9         
10
11     var fundingTopHeader = $('.funding-top-header');
12     var fundingHandle = $('.funding-handle');
13     if(fundingTopHeader) {
14         var currentOfferId = fundingTopHeader.attr('data-offer-id');
15         var toggle = true;
16         if(Modernizr.localstorage) {
17             toggle = localStorage['hide-offer-id'] !== currentOfferId;
18         }
19         fundingTopHeader.toggle(toggle);
20         fundingHandle.toggle(!toggle);
21     }
22     fundingHandle.click(function(e) {
23         fundingTopHeader.slideDown();
24         $(e.target).hide();
25         localStorage.removeItem('hide-offer-id');
26     });\r
27 });