| | 81 | |
| | 82 | // Listen for Drag & Drop |
| | 83 | if ( CKEDITOR.env.ie ) |
| | 84 | { |
| | 85 | // Start of drag from inside the document |
| | 86 | editor.document.getBody().on( 'dragstart', function() |
| | 87 | { |
| | 88 | editor.fire( 'saveSnapshot' ); |
| | 89 | }); |
| | 90 | // Missing detection for dragging from outside |
| | 91 | |
| | 92 | // End of drag |
| | 93 | editor.document.getBody().on( 'drop', function() |
| | 94 | { |
| | 95 | setTimeout( function() { |
| | 96 | editor.fire( 'saveSnapshot' ); |
| | 97 | }, 0); |
| | 98 | }); |
| | 99 | } |
| | 100 | else |
| | 101 | { |
| | 102 | // Start of drag from inside the document |
| | 103 | editor.document.on( 'dragstart', function() |
| | 104 | { |
| | 105 | editor.fire( 'saveSnapshot' ); |
| | 106 | }); |
| | 107 | |
| | 108 | editor.document.on( 'dragenter', function(e) |
| | 109 | { |
| | 110 | // Start of drag from outside the document |
| | 111 | if ( editor.document.$.documentElement == e.data.$.target ) |
| | 112 | editor.fire( 'saveSnapshot' ); |
| | 113 | }); |
| | 114 | |
| | 115 | // Webkit doesn't fire this event unless ondragover is cancelled, but then the |
| | 116 | // drag&drop doesn't happe, and that's worse. |
| | 117 | editor.document.on( 'drop', function(e) |
| | 118 | { |
| | 119 | editor.fire( 'saveSnapshot' ); |
| | 120 | }); |
| | 121 | } |