Changeset 1275

Show
Ignore:
Timestamp:
2008-01-09 08:55:28 (6 months ago)
Author:
martinkou
Message:

Simplified the dragging logic of floating dialogs and eliminated all potential jumping problems during dialog dragging.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/branches/features/floating_dialog/editor/fckdialog.html

    r1268 r1275  
    279279        var lastCoords = null ; 
    280280         
    281         var getMouseCoordinates = function( evt ) 
    282         { 
    283                 var element = evt.srcElement || evt.target ; 
    284                 var doc = FCKTools.GetElementDocument( element ) ; 
    285                 var view = doc.parentWindow || evt.view ; 
    286                 var retval = { 'x': evt.clientX, 'y': evt.clientY }; 
    287  
    288                 if ( view != Args().TopWindow ) 
    289                 { 
    290                         var offset = FCKTools.GetDocumentPosition( Args().TopWindow, doc.documentElement ) ; 
    291                         retval.x += offset.x ; 
    292                         retval.y += offset.y ; 
    293                 } 
    294  
    295                 return retval ; 
    296         } 
    297  
    298281        var cleanUpHandlers = function() 
    299282        { 
     
    310293                        return ; 
    311294 
    312                 // Debouncing logic for Opera, for preventing the dialog from vibrating during mouse drags. 
    313                 if ( FCKBrowserInfo.IsOpera ) 
    314                 { 
    315                         if ( window.LastMoveTimestamp > (new Date()).getTime() - 20 ) 
    316                                 return ; 
    317                         else 
    318                                 window.LastMoveTimestamp = (new Date()).getTime() ; 
    319                 } 
    320  
    321295                if ( !evt ) 
    322296                        evt = FCKTools.GetElementDocument( this ).parentWindow.event ; 
    323297 
    324                 var currentCoords = getMouseCoordinates( evt ); 
     298                var currentCoords = {'x' : evt.screenX, 'y' : evt.screenY}; 
    325299                var dx = currentCoords.x - lastCoords.x; 
    326300                var dy = currentCoords.y - lastCoords.y; 
     
    368342                                return ; 
    369343 
    370                         lastCoords = getMouseCoordinates( evt ) ; 
     344                        lastCoords = {'x' : evt.screenX, 'y' : evt.screenY} ; 
    371345 
    372346                        for ( var i = 0 ; i < registeredWindows.length ; i++ )