[Libreoffice-commits] online.git: Branch 'libreoffice-6-0' - loleaflet/src
Marco Cecchetti
marco.cecchetti at collabora.com
Thu Dec 21 10:52:10 UTC 2017
loleaflet/src/control/Control.Header.js | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
New commits:
commit 510454c66bab6965cb618311cdcc5fac1f29d4e1
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Fri Dec 1 12:29:35 2017 +0100
loleaflet: calc: fix styles fetching in browsers different from Chrome
'font', 'border-width', 'border-color' are shortcut properties that
are available on Chrome but not on other browsers such as Firefox or
Edge.
Change-Id: I22d2a3db87b9d6f888bd345e06e605530358be51
Reviewed-on: https://gerrit.libreoffice.org/45665
Reviewed-by: Marco Cecchetti <mrcekets at gmail.com>
Tested-by: Marco Cecchetti <mrcekets at gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/46896
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
Tested-by: Jan Holesovsky <kendy at collabora.com>
diff --git a/loleaflet/src/control/Control.Header.js b/loleaflet/src/control/Control.Header.js
index a94663a2..d3b9c32d 100644
--- a/loleaflet/src/control/Control.Header.js
+++ b/loleaflet/src/control/Control.Header.js
@@ -24,10 +24,14 @@ L.Control.Header = L.Control.extend({
var elem = L.DomUtil.create('div', className, baseElem);
this._textColor = L.DomUtil.getStyle(elem, 'color');
this._backgroundColor = L.DomUtil.getStyle(elem, 'background-color');
- this._font = L.DomUtil.getStyle(elem, 'font');
- this._borderColor = L.DomUtil.getStyle(elem, 'border-color');
- var borderWidth = L.DomUtil.getStyle(elem, 'border-width');
- this._borderWidth = parseInt(borderWidth.slice(0, -2));
+ var fontFamily = L.DomUtil.getStyle(elem, 'font-family');
+ var fontSize = parseInt(L.DomUtil.getStyle(elem, 'font-size'));
+ var fontHeight = parseInt(L.DomUtil.getStyle(elem, 'line-height'));
+ var rate = fontHeight / fontSize;
+ this._font = fontSize + 'px/' + rate + ' ' + fontFamily;
+ this._borderColor = L.DomUtil.getStyle(elem, 'border-top-color');
+ var borderWidth = L.DomUtil.getStyle(elem, 'border-top-width');
+ this._borderWidth = parseInt(borderWidth);
this._cursor = L.DomUtil.getStyle(elem, 'cursor');
L.DomUtil.remove(elem);
},
More information about the Libreoffice-commits
mailing list