]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/tinymce/plugins/charmap/plugin.js
WordPress 4.0
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / plugins / charmap / plugin.js
index 203a38067ab32fc24875ea079af0d21518f2b66d..27b6a46da43bd5bf8c75b9904ca159c04f667bc6 100644 (file)
@@ -309,8 +309,13 @@ tinymce.PluginManager.add('charmap', function(editor) {
                        html: gridHtml,
                        onclick: function(e) {
                                var target = e.target;
-                               if (/^(TD|DIV)$/.test(target.nodeName)) {
-                                       editor.execCommand('mceInsertContent', false, tinymce.trim(target.innerText || target.textContent));
+
+                               if (target.tagName == 'TD') {
+                                       target = target.firstChild;
+                               }
+
+                               if (target.tagName == 'DIV') {
+                                       editor.execCommand('mceInsertContent', false, target.firstChild.data);
 
                                        if (!e.ctrlKey) {
                                                win.close();