Ticket #7959: 7959.patch
File 7959.patch, 1.4 KB (added by , 13 years ago) |
---|
-
_source/plugins/table/dialogs/table.js
106 106 onOk : function() 107 107 { 108 108 var selection = editor.getSelection(), 109 bms = selection.createBookmarks();109 bms = this._.selectedElement && selection.createBookmarks(); 110 110 111 111 var table = this._.selectedElement || makeElement( 'table' ), 112 112 me = this, … … 222 222 223 223 // Insert the table element if we're creating one. 224 224 if ( !this._.selectedElement ) 225 { 225 226 editor.insertElement( table ); 226 227 // Override the default cursor position after insertElement to place 228 // cursor inside the first cell (#7959), IE needs a while. 229 setTimeout( function() 230 { 231 var firstCell = new CKEDITOR.dom.element( table.$.rows[ 0 ].cells[ 0 ] ); 232 var range = new CKEDITOR.dom.range( editor.document ); 233 range.moveToPosition( firstCell, CKEDITOR.POSITION_AFTER_START ); 234 range.select( 1 ); 235 }, 0 ); 236 } 227 237 // Properly restore the selection, (#4822) but don't break 228 238 // because of this, e.g. updated table caption. 229 try { selection.selectBookmarks( bms ); } catch( er ){} 230 231 return true; 239 else 240 try { selection.selectBookmarks( bms ); } catch( er ){} 232 241 }, 233 242 contents : [ 234 243 {