mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-29 20:41:03 +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);
|
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;
|
||||||
|
|
||||||
|
if (!resized) {
|
||||||
$('html,body').animate({ scrollTop: scroll }, 'fast');
|
$('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
Loading…
Reference in a new issue