Changeset 602

Show
Ignore:
Timestamp:
2007-07-31 13:39:55 (3 years ago)
Author:
martinkou
Message:

Fix for #338 : Drag and drop within the editor window should not invoke the paste dialogs.

Location:
FCKeditor/trunk/editor/_source/internals
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/internals/fck_gecko.js

    r599 r602  
    4141        this._ExecDrop = function( evt ) 
    4242        { 
     43                if ( FCK._MouseDownFlag ) 
     44                        return ; 
    4345                if ( FCKConfig.ForcePasteAsPlainText ) 
    4446                { 
  • FCKeditor/trunk/editor/_source/internals/fck_ie.js

    r590 r602  
    9898function Doc_OnDrop() 
    9999{ 
     100        if ( FCK._MouseDownFlag ) 
     101                return ; 
    100102        var evt = FCK.EditorWindow.event ; 
    101103        if ( FCKConfig.ForcePasteAsPlainText ) 
  • FCKeditor/trunk/editor/_source/internals/fck.js

    r594 r602  
    761761} 
    762762 
     763function _FCK_MouseEventsListener( evt ) 
     764{ 
     765        if ( ! evt ) 
     766                evt = window.event ; 
     767        if ( evt.type == 'mousedown' ) 
     768                FCK._MouseDownFlag = true ; 
     769        else if ( evt.type == 'mouseup' ) 
     770                FCK._MouseDownFlag = false ; 
     771} 
     772 
    763773function _FCK_EditingArea_OnLoad() 
    764774{ 
     
    768778 
    769779        FCK.InitializeBehaviors() ; 
     780         
     781        // Listen for mousedown and mouseup events for tracking drag and drops. 
     782        FCK._MouseDownFlag = false ; 
     783        FCKTools.AddEventListener( FCK.EditorDocument, 'mousedown', _FCK_MouseEventsListener ) ; 
     784        FCKTools.AddEventListener( FCK.EditorDocument, 'mouseup', _FCK_MouseEventsListener ) ; 
    770785 
    771786        // Create the enter key handler