Opened 11 years ago
Closed 10 years ago
#13193 closed Bug (expired)
Dialog tab is disabled if has content elements of html type only
| Reported by: | Stevan Koprivica | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | UI : Dialogs | Version: | 4.4.7 |
| Keywords: | Cc: |
Description
In plugins/dialog/plugin.js, there's a bug in a show() method, evaluating if the tab shoud be disabled or not.
If the element has no input element, iteration never reaches evaluation if the element is required and can pass active content filter check.
If no element in the tab has input element, whole tab is disabled (and I'm sure it's unexpected when I have a tab with one html element in it).
Code excerpt
enableElements = 0;
for ( var j in this._.contents[ content.id ] ) {
var elem = this._.contents[ content.id ][ j ];
if ( elem.type == 'hbox' || elem.type == 'vbox' || !elem.getInputElement() )
continue;
// this code is never reached
if ( elem.requiredContent && !this._.editor.activeFilter.check( elem.requiredContent ) )
elem.disable();
else {
elem.enable();
enableElements++;
}
}
// and enableElements remains 0, so the tab is disabled
if ( !enableElements || ( requiredContent && !this._.editor.activeFilter.check( requiredContent ) ) )
tab[ 0 ].addClass( 'cke_dialog_tab_disabled' );
else
tab[ 0 ].removeClass( 'cke_dialog_tab_disabled' );
Attachments (1)
Change History (3)
comment:1 Changed 11 years ago by
| Status: | new → pending |
|---|
Changed 11 years ago by
| Attachment: | mytest.zip added |
|---|
comment:2 Changed 10 years ago by
| Resolution: | → expired |
|---|---|
| Status: | pending → closed |

I can't reproduce that. I have tried few times with one tab, then with two tabs but everything works as expected.
I'm attaching sample test plugin. It can be enabled with below code:
CKEDITOR.replace( 'editor1', {extraPlugins : 'mytest'} );@ctebah could you attach your sample plugin that demonstrates the problem or could you tell me what have I missed in mine?