Aleksander Machniak
2012-06-25 8f07bdcf20bcd0ac6749842bd85d710790c2c9ac
program/js/tiny_mce/plugins/table/editor_plugin_src.js
@@ -1237,15 +1237,18 @@
                        
            // Fixes an issue on Gecko where it's impossible to place the caret behind a table
            // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled
            if (!tinymce.isIE) {
               function fixTableCaretPos() {
                  var last;
                  // Skip empty text nodes form the end
                  for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;
                  if (last && last.nodeName == 'TABLE')
                     ed.dom.add(ed.getBody(), 'p', null, '<br data-mce-bogus="1" />');
               if (last && last.nodeName == 'TABLE') {
                  if (ed.settings.forced_root_block)
                     ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE ? '&nbsp;' : '<br data-mce-bogus="1" />');
                  else
                     ed.dom.add(ed.getBody(), 'br', {'data-mce-bogus': '1'});
               }
               };
               // Fixes an bug where it's impossible to place the caret before a table in Gecko
@@ -1283,8 +1286,9 @@
               ed.onPreProcess.add(function(ed, o) {
                  var last = o.node.lastChild;
                  if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR' && last.previousSibling && last.previousSibling.nodeName == "TABLE")
               if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 && (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) && last.previousSibling && last.previousSibling.nodeName == "TABLE") {
                     ed.dom.remove(last);
               }
               });
@@ -1307,7 +1311,6 @@
               fixTableCaretPos();
               ed.startContent = ed.getContent({format : 'raw'});
            }
         });
         // Register action commands