JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.4.1
[ckeditor.git] / _source / plugins / table / dialogs / table.js
index 7b06606..c6f8a05 100644 (file)
@@ -79,11 +79,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
                                if ( command == 'tableProperties' )\r
                                {\r
-                                       if ( ( selectedTable = editor.getSelection().getSelectedElement() ) )\r
-                                       {\r
-                                               if ( selectedTable.getName() != 'table' )\r
-                                                       selectedTable = null;\r
-                                       }\r
+                                       if ( ( selectedTable = selection.getSelectedElement() ) )\r
+                                               selectedTable = selectedTable.getAscendant( 'table', true );\r
                                        else if ( ranges.length > 0 )\r
                                        {\r
                                                // Webkit could report the following range on cell selection (#4948):\r
@@ -122,7 +119,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                if ( this._.selectedElement )\r
                                {\r
                                        var selection = editor.getSelection(),\r
-                                               bms = editor.getSelection().createBookmarks();\r
+                                               bms = selection.createBookmarks();\r
                                }\r
 \r
                                var table = this._.selectedElement || makeElement( 'table' ),\r
@@ -169,7 +166,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                for ( i = 0 ; i < theRow.getChildCount() ; i++ )\r
                                                {\r
                                                        var th = theRow.getChild( i );\r
-                                                       if ( th.type == CKEDITOR.NODE_ELEMENT )\r
+                                                       // Skip bookmark nodes. (#6155)\r
+                                                       if ( th.type == CKEDITOR.NODE_ELEMENT && !th.hasAttribute( '_cke_bookmark' ) )\r
                                                        {\r
                                                                th.renameNode( 'th' );\r
                                                                th.setAttribute( 'scope', 'col' );\r