mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-16 20:56:28 +00:00
Merge pull request #3653 from Simounet/fix/firefox-mobile-unneeded-resize
Fix/firefox mobile unneeded resize
This commit is contained in:
commit
9707ac4661
5 changed files with 8 additions and 6 deletions
|
@ -65,7 +65,7 @@ $(document).ready(() => {
|
|||
retrievePercent(x.entryId);
|
||||
|
||||
$(window).resize(() => {
|
||||
retrievePercent(x.entryId);
|
||||
retrievePercent(x.entryId, true);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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
Loading…
Reference in a new issue