From f136d288d6fbc57af680e9a738b023abbccf0d6d Mon Sep 17 00:00:00 2001 From: Simounet Date: Thu, 24 May 2018 08:27:15 +0200 Subject: 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. --- app/Resources/static/themes/_global/index.js | 2 +- app/Resources/static/themes/_global/js/tools.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'app/Resources/static/themes/_global') 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(() => { retrievePercent(x.entryId); $(window).resize(() => { - retrievePercent(x.entryId); + retrievePercent(x.entryId, true); }); } }); 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) { return true; } -function retrievePercent(id) { +function retrievePercent(id, resized) { if (!supportsLocalStorage()) { return false; } const bheight = $(document).height(); const percent = localStorage[`wallabag.article.${id}.percent`]; const scroll = bheight * percent; - $('html,body').animate({ scrollTop: scroll }, 'fast'); + if (!resized) { + $('html,body').animate({ scrollTop: scroll }, 'fast'); + } return true; } -- cgit v1.2.3