Преглед на файлове

Code style improvements.

Maciej Bukowski преди 7 години
родител
ревизия
82975bdb1c
променени са 2 файла, в които са добавени 11 реда и са изтрити 12 реда
  1. 1 1
      packages/ckeditor5-widget/src/widgettoolbar.js
  2. 10 11
      packages/ckeditor5-widget/tests/widgettoolbar.js

+ 1 - 1
packages/ckeditor5-widget/src/widgettoolbar.js

@@ -218,7 +218,7 @@ function repositionContextualBalloon( editor ) {
 function getBalloonPositionData( editor ) {
 	const editingView = editor.editing.view;
 	const defaultPositions = BalloonPanelView.defaultPositions;
-	let widget = getParentWidget( editingView.document.selection );
+	const widget = getParentWidget( editingView.document.selection );
 
 	return {
 		target: editingView.domConverter.viewToDom( widget ),

+ 10 - 11
packages/ckeditor5-widget/tests/widgettoolbar.js

@@ -32,7 +32,7 @@ describe( 'WidgetToolbar', () => {
 
 		return ClassicEditor
 			.create( editorElement, {
-				plugins: [ Paragraph, Image, FakeButton, WidgetToolbar, FakeWidget ],
+				plugins: [ Paragraph, FakeButton, WidgetToolbar, FakeWidget ],
 				fake: {
 					toolbar: [ 'fake_button' ]
 				}
@@ -244,7 +244,7 @@ describe( 'WidgetToolbar - integration with the BalloonToolbar', () => {
 
 		return BalloonEditor
 			.create( editorElement, {
-				plugins: [ Paragraph, Image, FakeButton, WidgetToolbar, FakeWidget, Bold ],
+				plugins: [ Paragraph, FakeButton, WidgetToolbar, FakeWidget, Bold ],
 				balloonToolbar: [ 'bold' ],
 				fake: {
 					toolbar: [ 'fake_button' ]
@@ -370,14 +370,13 @@ class FakeWidget extends Plugin {
 			}
 		} ) );
 
-		conversion.for( 'upcast' )
-			.add( upcastElementToElement( {
-				view: {
-					name: 'div'
-				},
-				model: ( viewMedia, modelWriter ) => {
-					return modelWriter.createElement( 'fake-widget' );
-				}
-			} ) )
+		conversion.for( 'upcast' ).add( upcastElementToElement( {
+			view: {
+				name: 'div'
+			},
+			model: ( view, modelWriter ) => {
+				return modelWriter.createElement( 'fake-widget' );
+			}
+		} ) );
 	}
 }