Ticket #1728: 1728.patch

File 1728.patch, 1.8 KB (added by Martin Kou, 16 years ago)

Proposed patch for fixing #1728.

  • editor/_source/internals/fcktoolbarset.js

     
    9090
    9191                        // Initialize the IFRAME document body.
    9292                        eTargetDocument.open() ;
    93                         eTargetDocument.write( '<html><head>' + sBase + '<script type="text/javascript"> var adjust = function() { window.frameElement.height = document.body.scrollHeight ; }; window.onresize = adjust; window.onload = function () {window.setTimeout( adjust, 0 );}</script></head><body style="overflow: hidden">' + document.getElementById( 'xToolbarSpace' ).innerHTML + '</body></html>' ) ;
     93                        eTargetDocument.write( '<html><head>' + sBase + '<script type="text/javascript"> var adjust = function() { window.frameElement.height = document.body.scrollHeight ; }; window.onresize = adjust; '
     94                                        + 'window.onload = function(){'         // poll scrollHeight until it no longer changes for 1 sec.
     95                                        + 'var timer = null;'
     96                                        + 'var lastHeight = -1;'
     97                                        + 'var lastChange = 0;'
     98                                        + 'var poller = function(){'
     99                                        + 'var currentHeight = document.body.scrollHeight || 0;'
     100                                        + 'var currentTime = (new Date()).getTime();'
     101                                        + 'if (currentHeight != lastHeight){'
     102                                        + 'lastChange = currentTime;'
     103                                        + 'adjust();'
     104                                        + 'lastHeight = document.body.scrollHeight;'
     105                                        + '}'
     106                                        + 'if (lastChange < currentTime - 1000) clearInterval(timer);'
     107                                        + '};'
     108                                        + 'timer = setInterval(poller, 100);'
     109                                        + '}'
     110                                        + '</script></head><body style="overflow: hidden">' + document.getElementById( 'xToolbarSpace' ).innerHTML + '</body></html>' ) ;
    94111                        eTargetDocument.close() ;
    95112
    96113                        FCKTools.AddEventListener( eTargetDocument, 'contextmenu', FCKTools.CancelEvent ) ;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy