]>
git.immae.eu Git - github/wallabag/wallabag.git/blob - _global/public/js/restoreScroll.js
1 function supportsLocalStorage() {
3 return 'localStorage' in window
&& window
['localStorage'] !== null;
9 function savePercent(id
, percent
) {
10 if (!supportsLocalStorage()) { return false; }
11 localStorage
["poche.article." + id
+ ".percent"] = percent
;
15 function retrievePercent(id
) {
16 if (!supportsLocalStorage()) { return false; }
18 var bheight
= $(document
).height();
19 var percent
= localStorage
["poche.article." + id
+ ".percent"];
20 var scroll
= bheight
* percent
;
22 $('html,body').animate({scrollTop: scroll
}, 'fast');