[Libreoffice-commits] online.git: loleaflet/src
Marco Cecchetti
marco.cecchetti at collabora.com
Mon Dec 4 10:54:18 UTC 2017
loleaflet/src/control/Control.Header.js | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
New commits:
commit 1943c4b8f12f5ca48b36501710e2b7d1b82d1ea4
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>
diff --git a/loleaflet/src/control/Control.Header.js b/loleaflet/src/control/Control.Header.js
index 3da83248..4bb38769 100644
--- a/loleaflet/src/control/Control.Header.js
+++ b/loleaflet/src/control/Control.Header.js
@@ -51,10 +51,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