mirror of
https://github.com/wallabag/wallabag.git
synced 2025-03-05 19:01:05 +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);
|
retrievePercent(x.entryId);
|
||||||
|
|
||||||
$(window).resize(() => {
|
$(window).resize(() => {
|
||||||
retrievePercent(x.entryId);
|
retrievePercent(x.entryId, true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,14 +19,16 @@ function savePercent(id, percent) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function retrievePercent(id) {
|
function retrievePercent(id, resized) {
|
||||||
if (!supportsLocalStorage()) { return false; }
|
if (!supportsLocalStorage()) { return false; }
|
||||||
|
|
||||||
const bheight = $(document).height();
|
const bheight = $(document).height();
|
||||||
const percent = localStorage[`wallabag.article.${id}.percent`];
|
const percent = localStorage[`wallabag.article.${id}.percent`];
|
||||||
const scroll = bheight * percent;
|
const scroll = bheight * percent;
|
||||||
|
|
||||||
$('html,body').animate({ scrollTop: scroll }, 'fast');
|
if (!resized) {
|
||||||
|
$('html,body').animate({ scrollTop: scroll }, 'fast');
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
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