Ticket #5364: 5364.patch

File 5364.patch, 1.7 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/dialog/plugin.js

     
    505505
    506506                for ( i = 0 ; i < buttons.length ; i++ )
    507507                        this._.buttons[ buttons[i].id ] = buttons[i];
    508 
    509                 CKEDITOR.skins.load( editor, 'dialog' );
    510508        };
    511509
    512510        // Focusable interface. Use it via dialog.addFocusable.
     
    28222820                                me = this;
    28232821
    28242822                        body.setStyle( 'cursor', 'wait' );
    2825                         CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( dialogDefinitions ), function()
    2826                                 {
    2827                                         // In case of plugin error, mark it as loading failed.
    2828                                         if ( typeof CKEDITOR.dialog._.dialogDefinitions[ dialogName ] != 'function' )
    2829                                                         CKEDITOR.dialog._.dialogDefinitions[ dialogName ] =  'failed';
    2830                                         me.openDialog( dialogName, callback );
    2831                                         body.setStyle( 'cursor', cursor );
    2832                                 } );
     2823
     2824                        function onDialogFileLoaded( success )
     2825                        {
     2826                                var dialogDefinition = CKEDITOR.dialog._.dialogDefinitions[ dialogName ],
     2827                                                skin = me.skin.dialog;
     2828
     2829                                // Check if both skin part and definition is loaded.
     2830                                if ( !skin._isLoaded || typeof success == 'undefined' )
     2831                                        return;
     2832
     2833                                // In case of plugin error, mark it as loading failed.
     2834                                if ( typeof dialogDefinition != 'function' )
     2835                                        CKEDITOR.dialog._.dialogDefinitions[ dialogName ] = 'failed';
     2836
     2837                                me.openDialog( dialogName, callback );
     2838                                body.setStyle( 'cursor', cursor );
     2839                        }
    28332840
     2841                        CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( dialogDefinitions ), onDialogFileLoaded );
     2842                        CKEDITOR.skins.load( this, 'dialog', onDialogFileLoaded );
     2843
    28342844                        return null;
    28352845                }
    28362846        });
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy