Преглед изворни кода

Removed writer from event data.

Oskar Wróbel пре 8 година
родитељ
комит
4f23e9fc36
1 измењених фајлова са 3 додато и 9 уклоњено
  1. 3 9
      packages/ckeditor5-clipboard/src/clipboard.js

+ 3 - 9
packages/ckeditor5-clipboard/src/clipboard.js

@@ -183,13 +183,9 @@ export default class Clipboard extends Plugin {
 
 			data.preventDefault();
 
-			model.change( writer => {
-				const content = editor.data.toView( editor.data.getSelectedContent( doc.selection ) );
+			const content = editor.data.toView( editor.data.getSelectedContent( doc.selection ) );
 
-				// This is really bad that writer is passed along with this event.
-				// We need to figure out something better.
-				editingView.fire( 'clipboardOutput', { dataTransfer, content, method: evt.name, writer } );
-			} );
+			editingView.fire( 'clipboardOutput', { dataTransfer, content, method: evt.name } );
 		}
 
 		this.listenTo( editingView, 'copy', onCopyCut, { priority: 'low' } );
@@ -210,9 +206,7 @@ export default class Clipboard extends Plugin {
 			}
 
 			if ( data.method == 'cut' ) {
-				model.enqueueChange( data.writer.batch, () => {
-					editor.data.deleteContent( doc.selection );
-				} );
+				editor.data.deleteContent( doc.selection );
 			}
 		}, { priority: 'low' } );
 	}