Explorar el Código

Fix code style in image/utils.js.

Maciej Gołaszewski hace 7 años
padre
commit
5b812a8a62
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      packages/ckeditor5-image/src/image/utils.js

+ 4 - 2
packages/ckeditor5-image/src/image/utils.js

@@ -100,7 +100,9 @@ export function isImageAllowed( model ) {
 	const schema = model.schema;
 	const selection = model.document.selection;
 
-	return isImageAllowedInParent( selection, schema, model ) && checkSelectionOnObject( selection, schema ) && isInOtherImage( selection );
+	return isImageAllowedInParent( selection, schema, model ) &&
+		!checkSelectionOnObject( selection, schema ) &&
+		isInOtherImage( selection );
 }
 
 // Checks if image is allowed by schema in optimal insertion parent.
@@ -118,7 +120,7 @@ function isImageAllowedInParent( selection, schema, model ) {
 function checkSelectionOnObject( selection, schema ) {
 	const selectedElement = selection.getSelectedElement();
 
-	return !( !!selectedElement && schema.isObject( selectedElement ) );
+	return selectedElement && schema.isObject( selectedElement );
 }
 
 // Checks if selection is placed in other image (ie. in caption).