Level 58
You can use the onShow event to catch when the tab is shown. Here's an example:
CKEDITOR.on( 'dialogDefinition', function( ev ) {
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
if ( dialogName == 'image' ) {
dialogDefinition.dialog.on( 'showTab', function( evt ) {
if ( evt.data.id == 'uploadTab' ) {
console.log( 'Upload tab shown' );
// Do something here
}
});
dialogDefinition.addContents({
id : 'uploadTab',
label : 'upload',
elements : [
{
type: 'text',
id: 'uploadField',
label: 'upload',
}
]
});
}
});
In this example, we're using the on method to listen for the showTab event. When the event is fired, we check if the ID of the tab is uploadTab. If it is, we log a message to the console and do something else if needed.
