[Libreoffice-commits] online.git: loleaflet/src
Henry Castro (via logerrit)
logerrit at kemper.freedesktop.org
Mon Aug 3 16:49:42 UTC 2020
loleaflet/src/control/Ruler.js | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit 6a7a8a8ace164b4bf6b5f55b3615a660ec700600
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Fri Jul 31 17:19:51 2020 -0400
Commit: Henry Castro <hcastro at collabora.com>
CommitDate: Mon Aug 3 18:49:23 2020 +0200
loleaflet: fix uncaught type error on resize
It happens when the ruler call "fixOffset" function
Change-Id: I3a61147bd9b0d9bc705d9f6a70c06bd5345d660a
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99907
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Henry Castro <hcastro at collabora.com>
diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js
index 707a79dd8..79c89ae37 100644
--- a/loleaflet/src/control/Ruler.js
+++ b/loleaflet/src/control/Ruler.js
@@ -401,6 +401,9 @@ L.Control.Ruler = L.Control.extend({
/// from the tiles that we have already.
var tiles = this._map._docLayer._tiles;
var firstTileKey = Object.keys(tiles)[0];
+ if (!firstTileKey) {
+ return;
+ }
var columnNumber = parseInt(firstTileKey.match(/(\d*):/)[1]);
var firstTile = tiles[firstTileKey].el;
var firstTileXTranslate = parseInt(firstTile.style.left) - this._map._docLayer._tileWidthPx * columnNumber;
More information about the Libreoffice-commits
mailing list