[Libreoffice-commits] online.git: Branch 'libreoffice-5-4' - loleaflet/src
Aron Budea
aron.budea at collabora.com
Wed Jan 31 16:40:59 UTC 2018
loleaflet/src/control/Control.CharacterMap.js | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
New commits:
commit ef28034632f8f1407a28b1752252aece185c9aa2
Author: Aron Budea <aron.budea at collabora.com>
Date: Thu Oct 26 15:35:19 2017 +0200
loleaflet: make char preview work in Special Characters dialog
Previously loading animation was shown if the user clicked below
the glyph.
Change-Id: Ic13eb06139a352e47db8db85ae2948e0fbab282c
Reviewed-on: https://gerrit.libreoffice.org/43895
Reviewed-by: Henry Castro <hcastro at collabora.com>
Tested-by: Henry Castro <hcastro at collabora.com>
(cherry picked from commit bd306e3dbe3425b5e9884a66599ce0fc342bcfe2)
Reviewed-on: https://gerrit.libreoffice.org/49013
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
diff --git a/loleaflet/src/control/Control.CharacterMap.js b/loleaflet/src/control/Control.CharacterMap.js
index 7646475d..8d7fe6a4 100644
--- a/loleaflet/src/control/Control.CharacterMap.js
+++ b/loleaflet/src/control/Control.CharacterMap.js
@@ -480,9 +480,18 @@ L.Control.CharacterMap = L.Control.extend({
_onSymbolClick: function (e) {
var target = e.target || e.srcElement;
+ var realData;
+ if (typeof target.data !== 'undefined')
+ {
+ realData = target.data;
+ }
+ else if (target.childElementCount > 0)
+ {
+ realData = target.childNodes[0].data;
+ }
var encodedFont = window.encodeURIComponent(this._fontNames.options[this._fontNames.selectedIndex].value);
- var encodedChar = window.encodeURIComponent(String.fromCharCode(target.data));
- this._hexa.data = target.data;
+ var encodedChar = window.encodeURIComponent(String.fromCharCode(realData));
+ this._hexa.data = realData;
if (this.cacheGlyph[encodedFont + encodedChar]) {
this._preview.src = this.cacheGlyph[encodedFont + encodedChar].src;
} else {
More information about the Libreoffice-commits
mailing list