/*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
\r
onLoad : function()\r
{\r
- var dialog = this,\r
- isUpdating;\r
+ var dialog = this;\r
\r
var styles = dialog.getContentElement( 'advanced', 'advStyles' );\r
\r
{\r
styles.on( 'change', function( evt )\r
{\r
- if ( isUpdating )\r
- return;\r
-\r
- // Flag to avoid recursion.\r
- isUpdating = 1;\r
-\r
// Synchronize width value.\r
var width = this.getStyle( 'width', '' ),\r
txtWidth = dialog.getContentElement( 'info', 'txtWidth' ),\r
width = parseInt( width, 10 );\r
}\r
\r
- txtWidth && txtWidth.setValue( width );\r
- cmbWidthType && cmbWidthType.setValue( isPx ? 'pixels' : 'percents' );\r
+ txtWidth && txtWidth.setValue( width, true );\r
+ cmbWidthType && cmbWidthType.setValue( isPx ? 'pixels' : 'percents', true );\r
\r
// Synchronize height value.\r
var height = this.getStyle( 'height', '' ),\r
txtHeight = dialog.getContentElement( 'info', 'txtHeight' );\r
\r
height && ( height = parseInt( height, 10 ) );\r
- txtHeight && txtHeight.setValue( height );\r
-\r
- isUpdating = 0;\r
+ txtHeight && txtHeight.setValue( height, true );\r
});\r
}\r
},\r
\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
this._.selectedElement = selectedTable;\r
}\r
\r
- // Enable, disable and select the row, cols, width fields.\r
+ // Enable or disable the row, cols, width fields.\r
if ( selectedTable )\r
{\r
this.setupContent( selectedTable );\r
rowsInput && rowsInput.disable();\r
colsInput && colsInput.disable();\r
- widthInput && widthInput.select();\r
}\r
else\r
{\r
rowsInput && rowsInput.enable();\r
colsInput && colsInput.enable();\r
- rowsInput && rowsInput.select();\r
}\r
\r
// Call the onChange method for the widht and height fields so\r
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
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.data( 'cke-bookmark' ) )\r
{\r
th.renameNode( 'th' );\r
th.setAttribute( 'scope', 'col' );\r
id : 'cmbAlign',\r
type : 'select',\r
'default' : '',\r
- label : editor.lang.table.align,\r
+ label : editor.lang.common.align,\r
items :\r
[\r
[ editor.lang.common.notSet , ''],\r
- [ editor.lang.table.alignLeft , 'left'],\r
- [ editor.lang.table.alignCenter , 'center'],\r
- [ editor.lang.table.alignRight , 'right']\r
+ [ editor.lang.common.alignLeft , 'left'],\r
+ [ editor.lang.common.alignCenter , 'center'],\r
+ [ editor.lang.common.alignRight , 'right']\r
],\r
setup : function( selectedTable )\r
{\r
type : 'text',\r
id : 'txtWidth',\r
style : 'width:5em',\r
- label : editor.lang.table.width,\r
+ label : editor.lang.common.width,\r
'default' : 500,\r
validate : CKEDITOR.dialog.validate['number']( editor.lang.table.invalidWidth ),\r
\r
type : 'text',\r
id : 'txtHeight',\r
style : 'width:5em',\r
- label : editor.lang.table.height,\r
+ label : editor.lang.common.height,\r
'default' : '',\r
validate : CKEDITOR.dialog.validate['number']( editor.lang.table.invalidHeight ),\r
\r
if ( nodeList.count() > 0 )\r
{\r
var caption = nodeList.getItem( 0 );\r
- caption = ( caption.getChild( 0 ) && caption.getChild( 0 ).getText() ) || '';\r
- caption = CKEDITOR.tools.trim( caption );\r
+ caption = CKEDITOR.tools.trim( caption.getText() );\r
this.setValue( caption );\r
}\r
},\r