mirror of
https://github.com/wallabag/wallabag.git
synced 2025-01-31 15:55:06 +01:00
Merge pull request #3653 from Simounet/fix/firefox-mobile-unneeded-resize
Fix/firefox mobile unneeded resize
This commit is contained in:
commit
9707ac4661
@ -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…
x
Reference in New Issue
Block a user