From: Radek Czajka Date: Thu, 2 Oct 2014 11:24:30 +0000 (+0200) Subject: Fix top bar flickering problem. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/5d3277b79ffef805948ca0e105135d13179926b6 Fix top bar flickering problem. --- diff --git a/apps/funding/static/funding/funding.js b/apps/funding/static/funding/funding.js index 5b3b3f072..765bddcad 100644 --- a/apps/funding/static/funding/funding.js +++ b/apps/funding/static/funding/funding.js @@ -6,22 +6,13 @@ $(function() { if(Modernizr.localstorage) localStorage['hide-offer-id'] = fundNode.attr('data-offer-id'); }); - - var fundingTopHeader = $('.funding-top-header'); - var fundingHandle = $('.funding-handle'); - if(fundingTopHeader) { - var currentOfferId = fundingTopHeader.attr('data-offer-id'); - var toggle = true; - if(Modernizr.localstorage) { - toggle = localStorage['hide-offer-id'] !== currentOfferId; - } - fundingTopHeader.toggle(toggle); - fundingHandle.toggle(!toggle); - } + var fundingTopHeader = $('#funding-closeable'); + var fundingHandle = $('#funding-handle'); fundingHandle.click(function(e) { fundingTopHeader.slideDown(); $(e.target).hide(); - localStorage.removeItem('hide-offer-id'); + if(Modernizr.localstorage) + localStorage.removeItem('hide-offer-id'); }); }); \ No newline at end of file diff --git a/apps/funding/templates/funding/includes/funding.html b/apps/funding/templates/funding/includes/funding.html index 66804a427..c8f62d275 100644 --- a/apps/funding/templates/funding/includes/funding.html +++ b/apps/funding/templates/funding/includes/funding.html @@ -5,7 +5,7 @@ {% if offer %} -
+
{% if closeable %}X{% endif %} {% if link and is_current %}
@@ -45,9 +45,28 @@
{% if closeable %} -
{% trans "Help free the book!" %}
+
{% trans "Help free the book!" %}
+ + + {% endif %} + {% endif %} {% endspaceless %} diff --git a/apps/wolnelektury_core/static/scss/funding/funding.scss b/apps/wolnelektury_core/static/scss/funding/funding.scss index 617cc47f9..3b63e2037 100644 --- a/apps/wolnelektury_core/static/scss/funding/funding.scss +++ b/apps/wolnelektury_core/static/scss/funding/funding.scss @@ -4,7 +4,12 @@ @include size(padding, 5px 0); position: relative; .close { - @include size(font-size, 10px); + @include mono; + @include size(font-size, 16px); + position: absolute; + top: 0px; + right: 0; + @include size(padding, 1px 5px 10px 10px); } .call-area { float:left; @@ -119,11 +124,6 @@ font-weight: bold; @include size(font-size, 15px); } - .close { - position: absolute; - top: 0px; - @include size(right, 5px); - } } .funding-top-header { @@ -195,7 +195,10 @@ } } -.funding-handle { +#funding-closeable { + display: none; +} +#funding-handle { position: absolute; top: 0; right: 0;