Ticket #4687: 4687_2.patch

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

     
    644644        // Fixing Firefox 'Back-Forward Cache' break design mode. (#4514)
    645645        if( CKEDITOR.env.gecko )
    646646        {
    647                 var topBody = new CKEDITOR.dom.element( window.top.document.body );
    648                 topBody.setAttribute( 'onpageshow', topBody.getAttribute( 'onpageshow' )
    649                                 + ';event.persisted && CKEDITOR.tools.callFunction(' +
    650                                 CKEDITOR.tools.addFunction( function()
    651                                 {
    652                                         var allInstances = CKEDITOR.instances,
    653                                                 editor,
    654                                                 doc;
    655                                         for( var i in allInstances )
    656                                         {
    657                                                 editor = allInstances[ i ];
    658                                                 doc = editor.document;
    659                                                 if( doc )
    660                                                 {
    661                                                         doc.$.designMode = 'off';
    662                                                         doc.$.designMode = 'on';
    663                                                 }
    664                                         }
    665                                 } ) + ')' );
    666         }
    667 })();
     647                var topWin = window.top;
     648
     649                ( function ()
     650                {
     651                        var topBody = topWin.document.body;
     652
     653                        if( !topBody )
     654                                topWin.addEventListener( 'load', arguments.callee, false );
     655                        else
     656                        {
     657                                topBody.setAttribute( 'onpageshow', topBody.getAttribute( 'onpageshow' )
     658                                                + ';event.persisted && CKEDITOR.tools.callFunction(' +
     659                                                CKEDITOR.tools.addFunction( function()
     660                                                {
     661                                                        var allInstances = CKEDITOR.instances,
     662                                                                editor,
     663                                                                doc;
     664                                                        for( var i in allInstances )
     665                                                        {
     666                                                                editor = allInstances[ i ];
     667                                                                doc = editor.document;
     668                                                                if( doc )
     669                                                                {
     670                                                                        doc.$.designMode = 'off';
     671                                                                        doc.$.designMode = 'on';
     672                                                                }
     673                                                        }
     674                                                } ) + ')' );
     675                        }
     676                } )();
    668677
     678        }
     679})();
     680
    669681/**
    670682 * Disables the ability of resize objects (image and tables) in the editing
    671683 * area.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy