Aleksander Machniak
2014-04-15 a2e09c950d8716346b151f7980df1b51ebfbdd78
program/js/tiny_mce/plugins/table/js/table.js
@@ -91,7 +91,7 @@
      if (!capEl && caption) {
         capEl = elm.ownerDocument.createElement('caption');
         if (!tinymce.isIE)
         if (!tinymce.isIE || tinymce.isIE11)
            capEl.innerHTML = '<br data-mce-bogus="1"/>';
         elm.insertBefore(capEl, elm.firstChild);
@@ -199,7 +199,7 @@
   html += '>';
   if (caption) {
      if (!tinymce.isIE)
      if (!tinymce.isIE || tinymce.isIE11)
         html += '<caption><br data-mce-bogus="1"/></caption>';
      else
         html += '<caption></caption>';
@@ -209,7 +209,7 @@
      html += "<tr>";
      for (var x=0; x<cols; x++) {
         if (!tinymce.isIE)
         if (!tinymce.isIE || tinymce.isIE11)
            html += '<td><br data-mce-bogus="1"/></td>';
         else
            html += '<td></td>';
@@ -242,13 +242,16 @@
   } else
      inst.execCommand('mceInsertContent', false, html);
   tinymce.each(dom.select('table[data-mce-new]'), function(node) {
   tinymce.each(dom.select('table[data-mce-new]'), function(node) {
      var tdorth = dom.select('td,th', node);
      // Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document
      if (tinymce.isIE && node.nextSibling == null) {
         dom.insertAfter(dom.create('p'), node);
      }
      if (tinymce.isIE && !tinymce.isIE11 && node.nextSibling == null) {
         if (inst.settings.forced_root_block)
            dom.insertAfter(dom.create(inst.settings.forced_root_block), node);
         else
            dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node);
      }
      try {
         // IE9 might fail to do this selection 
@@ -304,6 +307,15 @@
   var formObj = document.forms[0];
   var elm = dom.getParent(inst.selection.getNode(), "table");
   // Hide advanced fields that isn't available in the schema
   tinymce.each("summary id rules dir style frame".split(" "), function(name) {
      var tr = tinyMCEPopup.dom.getParent(name, "tr") || tinyMCEPopup.dom.getParent("t" + name, "tr");
      if (tr && !tinyMCEPopup.editor.schema.isValid("table", name)) {
         tr.style.display = 'none';
      }
   });
   action = tinyMCEPopup.getWindowArg('action');
   if (!action)