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

Cleaning code after last refactor.

Kuba Niegowski 5 лет назад
Родитель
Сommit
69e9b6d610

+ 4 - 4
packages/ckeditor5-widget/src/widgettypearound/widgettypearound.js

@@ -648,13 +648,13 @@ export default class WidgetTypeAround extends Plugin {
 		const documentSelection = model.document.selection;
 
 		this.listenTo( editor.model, 'insertContent', ( evt, [ content, selectable ] ) => {
-			const typeAroundSelectionAttributeValue = documentSelection.getAttribute( TYPE_AROUND_SELECTION_ATTRIBUTE );
-
-			if ( !typeAroundSelectionAttributeValue ) {
+			if ( selectable && !selectable.is( 'documentSelection' ) ) {
 				return;
 			}
 
-			if ( selectable && !selectable.is( 'documentSelection' ) ) {
+			const typeAroundSelectionAttributeValue = documentSelection.getAttribute( TYPE_AROUND_SELECTION_ATTRIBUTE );
+
+			if ( !typeAroundSelectionAttributeValue ) {
 				return;
 			}