浏览代码

Cleaning code after last refactor.

Kuba Niegowski 5 年之前
父节点
当前提交
69e9b6d610
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      packages/ckeditor5-widget/src/widgettypearound/widgettypearound.js

+ 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;
 			}