mirror of
https://github.com/moparisthebest/wallabag
synced 2024-11-27 11:22:17 -05:00
[fix] remember scroll position for baggy theme #519
This commit is contained in:
parent
4ca17924a1
commit
25114854b3
@ -29,4 +29,23 @@
|
|||||||
{{ content | raw }}
|
{{ content | raw }}
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
<script src="{{ poche_url }}/themes/{{theme}}/js/restoreScroll.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
$(window).scroll(function(e){
|
||||||
|
var scrollTop = $(window).scrollTop();
|
||||||
|
var docHeight = $(document).height();
|
||||||
|
var scrollPercent = (scrollTop) / (docHeight);
|
||||||
|
var scrollPercentRounded = Math.round(scrollPercent*100)/100;
|
||||||
|
savePercent({{ entry.id|e }}, scrollPercentRounded);
|
||||||
|
});
|
||||||
|
|
||||||
|
retrievePercent({{ entry.id|e }});
|
||||||
|
|
||||||
|
$(window).resize(function(){
|
||||||
|
retrievePercent({{ entry.id|e }});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user