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

Changed: simplified code in MarkerOperation.

Szymon Cofalik 9 лет назад
Родитель
Сommit
d0b6e0c1a6
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      packages/ckeditor5-engine/src/model/operation/markeroperation.js

+ 1 - 1
packages/ckeditor5-engine/src/model/operation/markeroperation.js

@@ -100,10 +100,10 @@ export default class MarkerOperation extends Operation {
 			!( this.oldRange === null && this.newRange === null ) &&
 			!( this.oldRange !== null && this.newRange !== null && this.oldRange.isEqual( this.newRange ) );
 
-		const document = changeInMarkersCollection && ( this.oldRange || this.newRange ).root.document;
 		const type = this.newRange ? 'set' : 'remove';
 
 		if ( changeInMarkersCollection ) {
+			const document = ( this.oldRange || this.newRange ).root.document;
 			document.markers[ type ]( this.name, this.newRange );
 		}