diff options
author | Thomas Citharel <tcit@tcit.fr> | 2016-09-28 10:30:18 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2016-09-28 10:30:18 +0200 |
commit | c146f6940a176142084b4fc3c610d13aca60d90e (patch) | |
tree | 7bc4683febcf15a4fd6053bddd49e36c202adeda /app/Resources/static/themes/_global/js/restoreScroll.js | |
parent | 55345331c47ca6f389e38a842584c3062476601d (diff) | |
download | wallabag-c146f6940a176142084b4fc3c610d13aca60d90e.tar.gz wallabag-c146f6940a176142084b4fc3c610d13aca60d90e.tar.zst wallabag-c146f6940a176142084b4fc3c610d13aca60d90e.zip |
Assets work
* ES6 all the things !
* ESLint checks everything
* CSS fixes (use stylelint)
* Fix #2231
Diffstat (limited to 'app/Resources/static/themes/_global/js/restoreScroll.js')
-rw-r--r-- | app/Resources/static/themes/_global/js/restoreScroll.js | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/app/Resources/static/themes/_global/js/restoreScroll.js b/app/Resources/static/themes/_global/js/restoreScroll.js deleted file mode 100644 index 9c4d7e20..00000000 --- a/app/Resources/static/themes/_global/js/restoreScroll.js +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | function supportsLocalStorage() { | ||
2 | try { | ||
3 | return 'localStorage' in window && window.localStorage !== null; | ||
4 | } catch (e) { | ||
5 | return false; | ||
6 | } | ||
7 | } | ||
8 | |||
9 | function savePercent(id, percent) { | ||
10 | if (!supportsLocalStorage()) { return false; } | ||
11 | localStorage['wallabag.article.' + id + '.percent'] = percent; | ||
12 | return true; | ||
13 | } | ||
14 | |||
15 | function retrievePercent(id) { | ||
16 | if (!supportsLocalStorage()) { return false; } | ||
17 | |||
18 | var bheight = $(document).height(); | ||
19 | var percent = localStorage['wallabag.article.' + id + '.percent']; | ||
20 | var scroll = bheight * percent; | ||
21 | |||
22 | $('html,body').animate({ scrollTop: scroll }, 'fast'); | ||
23 | |||
24 | return true; | ||
25 | } | ||