diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2018-05-24 21:36:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-24 21:36:51 +0200 |
commit | 9707ac46613eea0c536d87f4c141d567fc2ef7d0 (patch) | |
tree | 55d1b3a28515208a4f01955d902570e3e53dbf1c /app | |
parent | 1d770f9867a30ae6ac1351de80b2ce733c2673fa (diff) | |
parent | 53ec80be94ecabfc2821bfa8d12ce59e61aeaf76 (diff) | |
download | wallabag-9707ac46613eea0c536d87f4c141d567fc2ef7d0.tar.gz wallabag-9707ac46613eea0c536d87f4c141d567fc2ef7d0.tar.zst wallabag-9707ac46613eea0c536d87f4c141d567fc2ef7d0.zip |
Merge pull request #3653 from Simounet/fix/firefox-mobile-unneeded-resize
Fix/firefox mobile unneeded resize
Diffstat (limited to 'app')
-rw-r--r-- | app/Resources/static/themes/_global/index.js | 2 | ||||
-rw-r--r-- | app/Resources/static/themes/_global/js/tools.js | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/app/Resources/static/themes/_global/index.js b/app/Resources/static/themes/_global/index.js index fddb476d..b810e5d7 100644 --- a/app/Resources/static/themes/_global/index.js +++ b/app/Resources/static/themes/_global/index.js | |||
@@ -65,7 +65,7 @@ $(document).ready(() => { | |||
65 | retrievePercent(x.entryId); | 65 | retrievePercent(x.entryId); |
66 | 66 | ||
67 | $(window).resize(() => { | 67 | $(window).resize(() => { |
68 | retrievePercent(x.entryId); | 68 | retrievePercent(x.entryId, true); |
69 | }); | 69 | }); |
70 | } | 70 | } |
71 | }); | 71 | }); |
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 | ||
22 | function retrievePercent(id) { | 22 | function 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 | } |