var index = y * width + x;
if (index < charmap.length) {
var chr = charmap[index];
+ var chrText = chr ? String.fromCharCode(parseInt(chr[0], 10)) : ' ';
- gridHtml += '<td title="' + chr[1] + '"><div tabindex="-1" title="' + chr[1] + '" role="button">' +
- (chr ? String.fromCharCode(parseInt(chr[0], 10)) : ' ') + '</div></td>';
+ gridHtml += (
+ '<td title="' + chr[1] + '"><div tabindex="-1" title="' + chr[1] + '" role="button" data-chr="' + chrText + '">' +
+ chrText +
+ '</div></td>'
+ );
} else {
gridHtml += '<td />';
}
if (/^(TD|DIV)$/.test(target.nodeName)) {
if (getParentTd(target).firstChild) {
- insertChar(tinymce.trim(target.innerText || target.textContent));
+ insertChar(target.getAttribute('data-chr'));
if (!e.ctrlKey) {
win.close();
getCharMap: getCharMap,
insertChar: insertChar
};
-});
+});
\ No newline at end of file