includes/clientside/tinymce/plugins/table/editor_plugin_src.js
changeset 588 20484deb89cd
parent 543 dffcbfbc4e59
child 778 57ce13805b6f
equal deleted inserted replaced
587:705ed7162315 588:20484deb89cd
     1 /**
     1 /**
     2  * $Id: editor_plugin_src.js 824 2008-04-28 15:12:06Z spocke $
     2  * $Id: editor_plugin_src.js 853 2008-05-27 08:05:35Z spocke $
     3  *
     3  *
     4  * @author Moxiecode
     4  * @author Moxiecode
     5  * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
     5  * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
     6  */
     6  */
     7 
     7 
   674 
   674 
   675 								var grid = getTableGrid(tableElm);
   675 								var grid = getTableGrid(tableElm);
   676 								var cpos = getCellPos(grid, tdElm);
   676 								var cpos = getCellPos(grid, tdElm);
   677 
   677 
   678 								// Only one row, remove whole table
   678 								// Only one row, remove whole table
   679 								if (grid.length == 1) {
   679 								if (grid.length == 1 && tableElm.nodeName == 'TBODY') {
   680 									inst.dom.remove(inst.dom.getParent(tableElm, "table"));
   680 									inst.dom.remove(inst.dom.getParent(tableElm, "table"));
   681 									return true;
   681 									return true;
   682 								}
   682 								}
   683 
   683 
   684 								// Move down row spanned cells
   684 								// Move down row spanned cells
   797 								var grid = getTableGrid(tableElm);
   797 								var grid = getTableGrid(tableElm);
   798 								var cpos = getCellPos(grid, tdElm);
   798 								var cpos = getCellPos(grid, tdElm);
   799 								var lastTDElm = null;
   799 								var lastTDElm = null;
   800 
   800 
   801 								// Only one col, remove whole table
   801 								// Only one col, remove whole table
   802 								if (grid.length > 1 && grid[0].length <= 1) {
   802 								if ((grid.length > 1 && grid[0].length <= 1) && tableElm.nodeName == 'TBODY') {
   803 									inst.dom.remove(inst.dom.getParent(tableElm, "table"));
   803 									inst.dom.remove(inst.dom.getParent(tableElm, "table"));
   804 									return true;
   804 									return true;
   805 								}
   805 								}
   806 
   806 
   807 								// Delete cells
   807 								// Delete cells