X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Ftable%2Fdialogs%2Ftable.js;h=7cb2708b85ddac79667bfde6da8b3f35141621ee;hb=039a051ccf3901311661022a30afd60fc38130c9;hp=7b06606adcac387ce190ff5e5ac580fa075367d5;hpb=9873d66421922c7aef8be0f5d2ab51e547b19e66;p=ckeditor.git diff --git a/_source/plugins/table/dialogs/table.js b/_source/plugins/table/dialogs/table.js index 7b06606..7cb2708 100644 --- a/_source/plugins/table/dialogs/table.js +++ b/_source/plugins/table/dialogs/table.js @@ -79,11 +79,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( command == 'tableProperties' ) { - if ( ( selectedTable = editor.getSelection().getSelectedElement() ) ) - { - if ( selectedTable.getName() != 'table' ) - selectedTable = null; - } + if ( ( selectedTable = selection.getSelectedElement() ) ) + selectedTable = selectedTable.getAscendant( 'table', true ); else if ( ranges.length > 0 ) { // Webkit could report the following range on cell selection (#4948): @@ -122,7 +119,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( this._.selectedElement ) { var selection = editor.getSelection(), - bms = editor.getSelection().createBookmarks(); + bms = selection.createBookmarks(); } var table = this._.selectedElement || makeElement( 'table' ), @@ -169,7 +166,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license for ( i = 0 ; i < theRow.getChildCount() ; i++ ) { var th = theRow.getChild( i ); - if ( th.type == CKEDITOR.NODE_ELEMENT ) + // Skip bookmark nodes. (#6155) + if ( th.type == CKEDITOR.NODE_ELEMENT && !th.hasAttribute( '_cke_bookmark' ) ) { th.renameNode( 'th' ); th.setAttribute( 'scope', 'col' ); @@ -606,8 +604,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( nodeList.count() > 0 ) { var caption = nodeList.getItem( 0 ); - caption = ( caption.getChild( 0 ) && caption.getChild( 0 ).getText() ) || ''; - caption = CKEDITOR.tools.trim( caption ); + caption = CKEDITOR.tools.trim( caption.getText() ); this.setValue( caption ); } },