loleaflet/src/control/Control.Header.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
New commits: commit 250eda5b800e6f4ac664976cb3e374435f63b857 Author: Marco Cecchetti <marco.cecche...@collabora.com> Date: Fri Dec 1 12:40:05 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/45667 Reviewed-by: Jan Holesovsky <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.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); }, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits