8
0
Просмотр исходного кода

Removed writer from event data.

Oskar Wróbel 8 лет назад
Родитель
Сommit
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' } );
 	}