Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html (revision 5276)
+++ /CKEditor/trunk/CHANGES.html (revision 5277)
@@ -91,4 +91,5 @@
#4026 : Office2003 skin has no toolbar button borders in High Contrast in IE7.
#4348 : There should have exception thrown when 'CKEDITOR_BASEPATH' could be figured out automatically.
+ #5364 : Focus may not put into dialog correctly when dialog skin file is loading slow.
Index: /CKEditor/trunk/_source/plugins/dialog/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/dialog/plugin.js (revision 5276)
+++ /CKEditor/trunk/_source/plugins/dialog/plugin.js (revision 5277)
@@ -506,6 +506,4 @@
for ( i = 0 ; i < buttons.length ; i++ )
this._.buttons[ buttons[i].id ] = buttons[i];
-
- CKEDITOR.skins.load( editor, 'dialog' );
};
@@ -2823,12 +2821,24 @@
body.setStyle( 'cursor', 'wait' );
- CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( dialogDefinitions ), function()
- {
- // In case of plugin error, mark it as loading failed.
- if ( typeof CKEDITOR.dialog._.dialogDefinitions[ dialogName ] != 'function' )
- CKEDITOR.dialog._.dialogDefinitions[ dialogName ] = 'failed';
- me.openDialog( dialogName, callback );
- body.setStyle( 'cursor', cursor );
- } );
+
+ function onDialogFileLoaded( success )
+ {
+ var dialogDefinition = CKEDITOR.dialog._.dialogDefinitions[ dialogName ],
+ skin = me.skin.dialog;
+
+ // Check if both skin part and definition is loaded.
+ if ( !skin._isLoaded || typeof success == 'undefined' )
+ return;
+
+ // In case of plugin error, mark it as loading failed.
+ if ( typeof dialogDefinition != 'function' )
+ CKEDITOR.dialog._.dialogDefinitions[ dialogName ] = 'failed';
+
+ me.openDialog( dialogName, callback );
+ body.setStyle( 'cursor', cursor );
+ }
+
+ CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( dialogDefinitions ), onDialogFileLoaded );
+ CKEDITOR.skins.load( this, 'dialog', onDialogFileLoaded );
return null;