[Libreoffice-commits] online.git: loleaflet/src
Aron Budea
aron.budea at collabora.com
Sun Nov 5 13:44:20 UTC 2017
loleaflet/src/control/Control.CharacterMap.js | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
New commits:
commit bd306e3dbe3425b5e9884a66599ce0fc342bcfe2
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>
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