|
499 | 499 |
|
500 | 500 | // Delete content with the low priority so one can overwrite cut data.
|
501 | 501 | editable.on( 'cut', function() {
|
502 |
| - editor.getSelection().getRanges()[ 0 ].deleteContents(); // @todo replace with the new delete content function |
| 502 | + editor.extractSelectedHtml(); |
503 | 503 | }, null, null, 999 );
|
504 | 504 | }
|
505 | 505 |
|
|
1421 | 1421 | // No we can safely delete content for the drag range...
|
1422 | 1422 | dragRange = editor.createRange();
|
1423 | 1423 | dragRange.moveToBookmark( dragBookmark );
|
1424 |
| - dragRange.deleteContents(); // @todo replace with the new delete content function |
| 1424 | + editable.extractHtmlFromRange( dragRange ); |
1425 | 1425 |
|
1426 | 1426 | // ...and paste content into the drop position.
|
1427 | 1427 | dropRange = editor.createRange();
|
|
1445 | 1445 | // Remove dragged content and make a snapshot.
|
1446 | 1446 | dataTransfer.sourceEditor.fire( 'saveSnapshot' );
|
1447 | 1447 |
|
1448 |
| - dragRange.deleteContents(); // @todo replace with the new delete content function |
| 1448 | + editable.extractHtmlFromRange( dragRange ); |
1449 | 1449 |
|
1450 | 1450 | dataTransfer.sourceEditor.getSelection().reset();
|
1451 | 1451 | dataTransfer.sourceEditor.fire( 'saveSnapshot' );
|
|
1944 | 1944 | if ( editor ) {
|
1945 | 1945 | this.sourceEditor = editor;
|
1946 | 1946 |
|
1947 |
| - // @todo replace with the new function |
1948 |
| - this.setData( 'text/html', editor.getSelection().getSelectedHtml() ); |
| 1947 | + this.setData( 'text/html', editor.getSelectedHtml( 1 ) ); |
1949 | 1948 |
|
1950 | 1949 | // Without setData( 'text', ... ) on dragstart there is no drop event in Safari.
|
1951 | 1950 | // Also 'text' data is empty as drop to the textarea does not work if we do not put there text.
|
|
0 commit comments