Ticket #7422: 7422_2.patch
File 7422_2.patch, 1.5 KB (added by , 14 years ago) |
---|
-
_source/plugins/undo/plugin.js
78 78 if ( !event.data.$.ctrlKey && !event.data.$.metaKey ) 79 79 undoManager.type( event ); 80 80 }); 81 }); 81 82 var innerDrag, savedRange; 83 var target = editor.document.getBody(); 84 85 // Event "dragstart" fires only when dragging 86 // from inside the own document. 87 target.on( 'dragstart', function() 88 { 89 innerDrag = 1; 90 editor.fire( 'saveSnapshot' ); 91 92 // There's always a "dragend" in accompany with "dragstart". 93 target.on( 'dragend', function( evt ) 94 { 95 evt.removeListener(); 96 innerDrag = 0; 97 setTimeout( function () { editor.fire( 'saveSnapshot' ); }, 0 ); 98 }); 99 }); 82 100 101 // Event "drop" only works for IE and FF right now 102 // to catch droppers from outside of the document. 103 target.on( 'drop', function() 104 { 105 if ( !innerDrag ) 106 { 107 CKEDITOR.env.ie && ( savedRange = editor.getSelection().getNative().createRange() ); 108 editor.fire( 'saveSnapshot' ); 109 savedRange.select(); 110 setTimeout( function () { editor.fire( 'saveSnapshot' ); }, 0 ); 111 } 112 }); 113 }); 114 83 115 // Always save an undo snapshot - the previous mode might have 84 116 // changed editor contents. 85 117 editor.on( 'beforeModeUnload', function()