JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.0.2
[ckeditor.git] / _source / plugins / table / dialogs / table.js
index 2c02aa2..6a082d2 100644 (file)
@@ -97,7 +97,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                }\r
                                        }\r
 \r
-                                       // Modify the table headers. Depends on havint rows and cols generated\r
+                                       // Modify the table headers. Depends on having rows and cols generated\r
                                        // correctly so it can't be done in commit functions.\r
 \r
                                        // Should we make a <thead>?\r
@@ -115,8 +115,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                        if ( th.type == CKEDITOR.NODE_ELEMENT )\r
                                                        {\r
                                                                th.renameNode( 'th' );\r
-                                                               if ( !i )\r
-                                                                       th.setAttribute( 'scope', 'col' );\r
+                                                               th.setAttribute( 'scope', 'col' );\r
                                                        }\r
                                                }\r
                                                thead.append( theRow.remove() );\r
@@ -153,7 +152,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                {\r
                                                        newCell = new CKEDITOR.dom.element( table.$.rows[ row ].cells[ 0 ] );\r
                                                        newCell.renameNode( 'th' );\r
-                                                       newCell.setAttribute( 'scope', 'col' );\r
+                                                       newCell.setAttribute( 'scope', 'row' );\r
                                                }\r
                                        }\r
 \r
@@ -166,7 +165,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                        if ( row.getParent().getName() == 'tbody' )\r
                                                        {\r
                                                                newCell = new CKEDITOR.dom.element( row.$.cells[0] );\r
-                                                               newCell.renameNode( 'td');\r
+                                                               newCell.renameNode( 'td' );\r
                                                                newCell.removeAttribute( 'scope' );\r
                                                        }\r
                                                }\r
@@ -175,16 +174,19 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                        // Set the width and height.\r
                                        var styles = [];\r
                                        if ( info.txtHeight )\r
-                                               styles.push( 'height:' + info.txtHeight + 'px' );\r
+                                               table.setStyle( 'height', CKEDITOR.tools.cssLength( info.txtHeight ) );\r
+                                       else\r
+                                               table.removeStyle( 'height' );\r
+\r
                                        if ( info.txtWidth )\r
                                        {\r
                                                var type = info.cmbWidthType || 'pixels';\r
-                                               styles.push( 'width:' + info.txtWidth + ( type == 'pixels' ? 'px' : '%' ) );\r
+                                               table.setStyle( 'width', info.txtWidth + ( type == 'pixels' ? 'px' : '%' ) );\r
                                        }\r
-                                       styles = styles.join( ';' );\r
-                                       if ( styles )\r
-                                               table.$.style.cssText = styles;\r
                                        else\r
+                                               table.removeStyle( 'width' );\r
+\r
+                                       if( !table.getAttribute( 'style' ) )\r
                                                table.removeAttribute( 'style' );\r
                                }\r
 \r