Merge pull request #3653 from Simounet/fix/firefox-mobile-unneeded-resize

Fix/firefox mobile unneeded resize
This commit is contained in:
Jérémy Benoist 2018-05-24 21:36:51 +02:00 committed by GitHub
commit 9707ac4661
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 6 deletions

View file

@ -65,7 +65,7 @@ $(document).ready(() => {
retrievePercent(x.entryId);
$(window).resize(() => {
retrievePercent(x.entryId);
retrievePercent(x.entryId, true);
});
}
});

View file

@ -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;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long