Ticket #4455: 4455.patch

File 4455.patch, 2.0 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    333333                                        // enables editing, and makes some
    334334                                        var activationScript =
    335335                                                '<script id="cke_actscrpt" type="text/javascript">' +
     336                                                        // Enable editing mode as early as possible to not
     337                                                        // be blocked by e.g. image loading. (#4455) 
     338                                                        'document.body.contentEditable = true;' +
    336339                                                        'window.onload = function()' +
    337340                                                        '{' +
    338341                                                                // Call the temporary function for the editing
     
    368371                                                        // Disable and re-enable the body to avoid IE from
    369372                                                        // taking the editing focus at startup. (#141 / #523)
    370373                                                        body.disabled = true;
    371                                                         body.contentEditable = true;
    372374                                                        body.removeAttribute( 'disabled' );
    373375                                                }
    374                                                 else
     376                                                // Firefox require design-mode been turned on to make
     377                                                // the cursor blinking before editing frame window gain
     378                                                // keyboard focus.
     379                                                else if ( CKEDITOR.env.gecko ) {
    375380                                                        domDocument.designMode = 'on';
    376 
     381                                                }
     382 
    377383                                                // IE, Opera and Safari may not support it and throw
    378384                                                // errors.
    379385                                                try { domDocument.execCommand( 'enableObjectResizing', false, !editor.config.disableObjectResizing ) ; } catch(e) {}
     
    417423                                                focusTarget.on( 'blur', function()
    418424                                                        {
    419425                                                                editor.focusManager.blur();
     426                                                               
     427                                                                if( CKEDITOR.env.gecko ) {
     428                                                                        editor.document.$.designMode = 'on';
     429                                                                }
    420430                                                        });
    421431
    422432                                                focusTarget.on( 'focus', function()
     
    448458                                                                }
    449459
    450460                                                                editor.focusManager.focus();
    451                                                         });
     461
     462
     463                                                                if( CKEDITOR.env.gecko )
     464                                                                        setTimeout( function()
     465                                                                        {
     466                                                                                editor.document.$.designMode = 'off';
     467                                                                        });
     468                                                        });
    452469
    453470                                                var keystrokeHandler = editor.keystrokeHandler;
    454471                                                if ( keystrokeHandler )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy