Ticket #5577: 5577.patch
File 5577.patch, 1.8 KB (added by , 14 years ago) |
---|
-
_source/plugins/tabletools/plugin.js
252 252 { 253 253 if ( selectionOrCell instanceof CKEDITOR.dom.selection ) 254 254 { 255 var colsToDelete = getSelectedCells( selectionOrCell ); 256 for ( var i = colsToDelete.length ; i >= 0 ; i-- ) 255 var colsToDelete = getSelectedCells( selectionOrCell ), 256 table = colsToDelete[ 0 ] && colsToDelete[ 0 ].getAscendant( 'table' ), 257 parent = table && table.$.parentNode, 258 cursorPosition = null; 259 260 for ( var i = colsToDelete.length - 1 ; i >= 0 ; i-- ) 257 261 { 258 262 if ( colsToDelete[ i ] ) 259 263 deleteColumns( colsToDelete[ i ] ); 260 264 } 265 266 if ( table && table.$.parentNode ) 267 cursorPosition = new CKEDITOR.dom.element( 268 table.$.getElementsByTagName( 'td' )[ 0 ] 269 || parent 270 ); 271 else 272 cursorPosition = new CKEDITOR.dom.element( parent ); 273 274 return cursorPosition; 261 275 } 262 276 else if ( selectionOrCell instanceof CKEDITOR.dom.element ) 263 277 { 264 278 // Get the cell's table. 265 279 var table = selectionOrCell.getAscendant( 'table' ); 280 if ( !table ) 281 return; 266 282 267 283 // Get the cell index. 268 284 var cellIndex = selectionOrCell.$.cellIndex; … … 288 304 row.$.removeChild( row.$.cells[ cellIndex ] ); 289 305 } 290 306 } 307 308 return null; 291 309 } 292 310 293 311 function insertCell( selection, insertBefore ) … … 767 785 exec : function( editor ) 768 786 { 769 787 var selection = editor.getSelection(); 770 deleteColumns( selection ); 788 var cell = deleteColumns( selection ); 789 cell && placeCursorInCell( cell, true ); 771 790 } 772 791 } ); 773 792