aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/Resources/static/themes/_global/js
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2016-06-09 19:02:38 +0200
committerThomas Citharel <tcit@tcit.fr>2016-06-09 19:02:38 +0200
commit0743287f955fd19fd1a04c91f3b40a4ac2236423 (patch)
tree42d9f4efef7c8099416e24ce751de78524b9a58a /app/Resources/static/themes/_global/js
parent5ecdfcd041767c9e3244a92bb0a6cc3c3f80fea3 (diff)
downloadwallabag-0743287f955fd19fd1a04c91f3b40a4ac2236423.tar.gz
wallabag-0743287f955fd19fd1a04c91f3b40a4ac2236423.tar.zst
wallabag-0743287f955fd19fd1a04c91f3b40a4ac2236423.zip
clean & lint stuff
Diffstat (limited to 'app/Resources/static/themes/_global/js')
-rw-r--r--app/Resources/static/themes/_global/js/restoreScroll.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/app/Resources/static/themes/_global/js/restoreScroll.js b/app/Resources/static/themes/_global/js/restoreScroll.js
index e63d06c6..9c4d7e20 100644
--- a/app/Resources/static/themes/_global/js/restoreScroll.js
+++ b/app/Resources/static/themes/_global/js/restoreScroll.js
@@ -1,25 +1,25 @@
1function supportsLocalStorage() { 1function supportsLocalStorage() {
2 try { 2 try {
3 return 'localStorage' in window && window['localStorage'] !== null; 3 return 'localStorage' in window && window.localStorage !== null;
4 } catch (e) { 4 } catch (e) {
5 return false; 5 return false;
6 } 6 }
7} 7}
8 8
9function savePercent(id, percent) { 9function savePercent(id, percent) {
10 if (!supportsLocalStorage()) { return false; } 10 if (!supportsLocalStorage()) { return false; }
11 localStorage["wallabag.article." + id + ".percent"] = percent; 11 localStorage['wallabag.article.' + id + '.percent'] = percent;
12 return true; 12 return true;
13} 13}
14 14
15function retrievePercent(id) { 15function retrievePercent(id) {
16 if (!supportsLocalStorage()) { return false; } 16 if (!supportsLocalStorage()) { return false; }
17 17
18 var bheight = $(document).height(); 18 var bheight = $(document).height();
19 var percent = localStorage["wallabag.article." + id + ".percent"]; 19 var percent = localStorage['wallabag.article.' + id + '.percent'];
20 var scroll = bheight * percent; 20 var scroll = bheight * percent;
21 21
22 $('html,body').animate({scrollTop: scroll}, 'fast'); 22 $('html,body').animate({ scrollTop: scroll }, 'fast');
23 23
24 return true; 24 return true;
25} 25}