loleaflet/js/w2ui-1.5.rc1.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
New commits: commit 8494d9c4b1b56ce1fd55a610d49ab9eb1662e6a5 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> AuthorDate: Tue Feb 5 08:06:53 2019 -0500 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Tue Feb 26 14:24:32 2019 +0100 leaflet: account for rounding error when scrolling toolbar On some mobile browsers (Chrome) we get the maximum scroll value that is 0.5 less than the real maximum, so we always think we still have room to scroll more right. This has the undesirable side-effect of keeping the >> button visible, even when there is no way to scroll further right. This allows for at most 1 pixel error. Change-Id: Ie2e8902f1e2f4f358f210e9b0236422bc4f1da00 Reviewed-on: https://gerrit.libreoffice.org/67995 Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Tested-by: Szymon Kłos <szymon.k...@collabora.com> (cherry picked from commit 01540059319258778dde4d5c9b26e811b979e1c2) Reviewed-on: https://gerrit.libreoffice.org/67503 diff --git a/loleaflet/js/w2ui-1.5.rc1.js b/loleaflet/js/w2ui-1.5.rc1.js index 023587e95..fbbcc3d63 100644 --- a/loleaflet/js/w2ui-1.5.rc1.js +++ b/loleaflet/js/w2ui-1.5.rc1.js @@ -13086,7 +13086,8 @@ var w2prompt = function (label, title, callBack) { if (scrollBox.scrollLeft() > 0) { box.find('.w2ui-scroll-left').show(); } - if (scrollBox.scrollLeft() < scrollBox.find(':first').outerWidth() - scrollBox.outerWidth()) { + // Allow for rounding errors (on mobile, the max scrollLeft we get is 0.5 less than the real max). + if (scrollBox.scrollLeft() < scrollBox.find(':first').outerWidth() - scrollBox.outerWidth() - 1) { box.find('.w2ui-scroll-right').show(); } } @@ -13790,7 +13791,8 @@ var w2prompt = function (label, title, callBack) { if (scrollBox.scrollLeft() > 0) { box.find('.w2ui-scroll-left').show(); } - if (scrollBox.scrollLeft() < scrollBox.find(':first').outerWidth() - scrollBox.outerWidth()) { + // Allow for rounding errors (on mobile, the max scrollLeft we get is 0.5 less than the real max). + if (scrollBox.scrollLeft() < scrollBox.find(':first').outerWidth() - scrollBox.outerWidth() - 1) { box.find('.w2ui-scroll-right').show(); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits