aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/Resources/static/themes/_global/js
diff options
context:
space:
mode:
authorSimounet <contact@simounet.net>2018-05-24 08:27:15 +0200
committerSimounet <contact@simounet.net>2018-05-24 09:04:02 +0200
commitf136d288d6fbc57af680e9a738b023abbccf0d6d (patch)
tree708720b087230b4c31d98a7f6f360a7f19332a14 /app/Resources/static/themes/_global/js
parent1d770f9867a30ae6ac1351de80b2ce733c2673fa (diff)
downloadwallabag-f136d288d6fbc57af680e9a738b023abbccf0d6d.tar.gz
wallabag-f136d288d6fbc57af680e9a738b023abbccf0d6d.tar.zst
wallabag-f136d288d6fbc57af680e9a738b023abbccf0d6d.zip
Fix Firefox mobile unneeded resize
Before that, on Firefox Mobile, when you were moving to the top or to the bottom of the page, you were stopped before to go to the opposite side.
Diffstat (limited to 'app/Resources/static/themes/_global/js')
-rw-r--r--app/Resources/static/themes/_global/js/tools.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js
index 774f4539..7e5a2b27 100644
--- a/app/Resources/static/themes/_global/js/tools.js
+++ b/app/Resources/static/themes/_global/js/tools.js
@@ -19,14 +19,16 @@ function savePercent(id, percent) {
19 return true; 19 return true;
20} 20}
21 21
22function retrievePercent(id) { 22function retrievePercent(id, resized) {
23 if (!supportsLocalStorage()) { return false; } 23 if (!supportsLocalStorage()) { return false; }
24 24
25 const bheight = $(document).height(); 25 const bheight = $(document).height();
26 const percent = localStorage[`wallabag.article.${id}.percent`]; 26 const percent = localStorage[`wallabag.article.${id}.percent`];
27 const scroll = bheight * percent; 27 const scroll = bheight * percent;
28 28
29 $('html,body').animate({ scrollTop: scroll }, 'fast'); 29 if (!resized) {
30 $('html,body').animate({ scrollTop: scroll }, 'fast');
31 }
30 32
31 return true; 33 return true;
32} 34}