Ticket #9749: 9749.patch

File 9749.patch, 1.8 KB (added by Wiktor Walc, 11 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    746746                                                        {
    747747                                                                var doc = editor.document;
    748748
    749                                                                 if ( CKEDITOR.env.gecko || CKEDITOR.env.opera )
     749                                                                if ( editable && CKEDITOR.env.gecko )
     750                                                                        blinkCursor();
     751                                                                else if ( CKEDITOR.env.opera )
    750752                                                                        doc.getBody().focus();
    751753                                                                // Webkit needs focus for the first time on the HTML element. (#6153)
    752754                                                                else if ( CKEDITOR.env.webkit )
     
    12801282                        // Use correct cursor for these elements
    12811283                        editor.addCss( 'img, input, textarea { cursor: default;}' );
    12821284
     1285                        // Switch on design mode for a short while and close it after then.
     1286                        function blinkCursor( retry )
     1287                        {
     1288                                if ( editor.readOnly )
     1289                                        return;
     1290
     1291                                CKEDITOR.tools.tryThese(
     1292                                        function()
     1293                                        {
     1294                                                editor.document.$.designMode = 'on';
     1295                                                setTimeout( function()
     1296                                                {
     1297                                                        editor.document.$.designMode = 'off';
     1298                                                        if ( CKEDITOR.currentInstance == editor )
     1299                                                                editor.document.getBody().focus();
     1300                                                }, 50 );
     1301                                        },
     1302                                        function()
     1303                                        {
     1304                                                // The above call is known to fail when parent DOM
     1305                                                // tree layout changes may break design mode. (#5782)
     1306                                                // Refresh the 'contentEditable' is a cue to this.
     1307                                                editor.document.$.designMode = 'off';
     1308                                                var body = editor.document.getBody();
     1309                                                body.setAttribute( 'contentEditable', false );
     1310                                                body.setAttribute( 'contentEditable', true );
     1311                                                // Try it again once..
     1312                                                !retry && blinkCursor( 1 );
     1313                                        });
     1314                        }
     1315
    12831316                        // Disable form elements editing mode provided by some browers. (#5746)
    12841317                        editor.on( 'insertElement', function ( evt )
    12851318                        {
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy