[Libreoffice-commits] online.git: loleaflet/js
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Feb 26 13:24:53 UTC 2019
loleaflet/js/w2ui-1.5.rc1.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 8494d9c4b1b56ce1fd55a610d49ab9eb1662e6a5
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Tue Feb 5 08:06:53 2019 -0500
Commit: Szymon Kłos <szymon.klos at 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.klos at collabora.com>
Tested-by: Szymon Kłos <szymon.klos at 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();
}
}
More information about the Libreoffice-commits
mailing list