summaryrefslogtreecommitdiff
path: root/_source/plugins/table/dialogs
diff options
context:
space:
mode:
authorDaniel Sutcliffe <dansut@users.sourceforge.net>2010-02-02 17:54:17 +0000
committerDaniel Sutcliffe <dansut@users.sourceforge.net>2010-02-02 17:54:17 +0000
commitb1de4b213ba60402d6d13a2a6892d5a422c4f8e4 (patch)
treee4adb31477ee586349cd935365a84aaee50c5899 /_source/plugins/table/dialogs
parent8630f2bc4d63b3320f5469d9532a1cba1dddb7a3 (diff)
downloadckeditor-b1de4b213ba60402d6d13a2a6892d5a422c4f8e4.tar.gz
ckeditor-b1de4b213ba60402d6d13a2a6892d5a422c4f8e4.tar.bz2
ckeditor-b1de4b213ba60402d6d13a2a6892d5a422c4f8e4.zip
Update CKEditor to 3.1 and make work as a bw package
Diffstat (limited to '_source/plugins/table/dialogs')
-rw-r--r--_source/plugins/table/dialogs/table.js24
1 files changed, 18 insertions, 6 deletions
diff --git a/_source/plugins/table/dialogs/table.js b/_source/plugins/table/dialogs/table.js
index 02031f4..45cab90 100644
--- a/_source/plugins/table/dialogs/table.js
+++ b/_source/plugins/table/dialogs/table.js
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
@@ -68,6 +68,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
},
onOk : function()
{
+ if ( this._.selectedElement )
+ {
+ var selection = editor.getSelection(),
+ bms = editor.getSelection().createBookmarks();
+ }
+
var table = this._.selectedElement || makeElement( 'table' ),
me = this,
data = {};
@@ -174,22 +180,28 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
// Set the width and height.
var styles = [];
if ( info.txtHeight )
- styles.push( 'height:' + info.txtHeight + 'px' );
+ table.setStyle( 'height', CKEDITOR.tools.cssLength( info.txtHeight ) );
+ else
+ table.removeStyle( 'height' );
+
if ( info.txtWidth )
{
var type = info.cmbWidthType || 'pixels';
- styles.push( 'width:' + info.txtWidth + ( type == 'pixels' ? 'px' : '%' ) );
+ table.setStyle( 'width', info.txtWidth + ( type == 'pixels' ? 'px' : '%' ) );
}
- styles = styles.join( ';' );
- if ( styles )
- table.$.style.cssText = styles;
else
+ table.removeStyle( 'width' );
+
+ if( !table.getAttribute( 'style' ) )
table.removeAttribute( 'style' );
}
// Insert the table element if we're creating one.
if ( !this._.selectedElement )
editor.insertElement( table );
+ // Properly restore the selection inside table. (#4822)
+ else
+ selection.selectBookmarks( bms );
return true;
},