Skip to content

Commit 039322a

Browse files
Piotr JasiunReinmar
authored andcommitted
Use (get|extract)SelectedHtml.
1 parent 45ff334 commit 039322a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

plugins/clipboard/plugin.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@
499499

500500
// Delete content with the low priority so one can overwrite cut data.
501501
editable.on( 'cut', function() {
502-
editor.getSelection().getRanges()[ 0 ].deleteContents(); // @todo replace with the new delete content function
502+
editor.extractSelectedHtml();
503503
}, null, null, 999 );
504504
}
505505

@@ -1421,7 +1421,7 @@
14211421
// No we can safely delete content for the drag range...
14221422
dragRange = editor.createRange();
14231423
dragRange.moveToBookmark( dragBookmark );
1424-
dragRange.deleteContents(); // @todo replace with the new delete content function
1424+
editable.extractHtmlFromRange( dragRange );
14251425

14261426
// ...and paste content into the drop position.
14271427
dropRange = editor.createRange();
@@ -1445,7 +1445,7 @@
14451445
// Remove dragged content and make a snapshot.
14461446
dataTransfer.sourceEditor.fire( 'saveSnapshot' );
14471447

1448-
dragRange.deleteContents(); // @todo replace with the new delete content function
1448+
editable.extractHtmlFromRange( dragRange );
14491449

14501450
dataTransfer.sourceEditor.getSelection().reset();
14511451
dataTransfer.sourceEditor.fire( 'saveSnapshot' );
@@ -1944,8 +1944,7 @@
19441944
if ( editor ) {
19451945
this.sourceEditor = editor;
19461946

1947-
// @todo replace with the new function
1948-
this.setData( 'text/html', editor.getSelection().getSelectedHtml() );
1947+
this.setData( 'text/html', editor.getSelectedHtml( 1 ) );
19491948

19501949
// Without setData( 'text', ... ) on dragstart there is no drop event in Safari.
19511950
// Also 'text' data is empty as drop to the textarea does not work if we do not put there text.

0 commit comments

Comments
 (0)