Opened 12 years ago
Last modified 12 years ago
#9560 confirmed Bug
CKE 3.x and 4.x - Undefined table width gets reset to default
Reported by: | Jakub Ś | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 3.6.1 |
Keywords: | Cc: |
Description (last modified by )
This is the continuation of #9478.
To reproduce:
- Clear editor contents with CRTL+A Backspace
- Insert default table
- Open table properties dialog, clear width value and click OK
- Open table properties one more time.
Result: Default table width 500px is present in width field and once you click OK table gets default width.
You have to use below code to see the bug
CKEDITOR.on( 'dialogDefinition', function( ev ) { var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; // Set default table width during creation. if(dialogName == 'table') { var infoTab = dialogDefinition.getContents( 'info' ); txtWidth = infoTab.get( 'txtWidth' ); txtWidth['default'] = '100%'; } if ( dialogName == 'tableProperties' ) { var infoTab = dialogDefinition.getContents( 'info' ); var tab = dialogDefinition.getContents( 'advanced' ); tab.remove ('advLangDir'); tab.remove ('advStyles'); tab.remove ('advCSSClasses'); } }); window.x = CKEDITOR.editor.replace('editor1', { removePlugins : 'button,div,filebrowser,flash,format,forms,horizontalrule,indent,justify,liststyle,pagebreak,showborders,stylescombo,templates', toolbar : [ ['Source', 'Table'] ], });
With this code bug can be reproduced in v4 but also in v3 from CKE 3.6.1 rev. [6979]
Change History (3)
comment:1 Changed 12 years ago by
Status: | new → confirmed |
---|
comment:2 Changed 12 years ago by
comment:3 Changed 12 years ago by
Description: | modified (diff) |
---|
I think I managed to narrow down even further. The line that actually causes the bug to appear is
tab.remove('advStyles')
. I updated a jsfiddle to v4 for this: http://jsfiddle.net/gz9b4/4/ - the code for replicating in 3.6.2 at least is as follows