mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-26 02:51:04 +00:00
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.
This commit is contained in:
parent
1d770f9867
commit
f136d288d6
4 changed files with 7 additions and 5 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;
|
||||
|
||||
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
Loading…
Reference in a new issue