Browse Source

Use proper event for selection change in core.treeModel.Document.

Szymon Cofalik 9 years ago
parent
commit
af76f0d1ea

+ 1 - 1
packages/ckeditor5-engine/src/treemodel/document.js

@@ -84,7 +84,7 @@ export default class Document {
 		this._roots = new Map();
 
 		// Add events that will update selection attributes.
-		this.selection.on( 'update', () => {
+		this.selection.on( 'change:range', () => {
 			this.selection._updateAttributes();
 		} );
 

+ 1 - 1
packages/ckeditor5-engine/tests/treemodel/document/document.js

@@ -174,7 +174,7 @@ describe( 'Document', () => {
 	it( 'should update selection attributes whenever selection gets updated', () => {
 		sinon.spy( doc.selection, '_updateAttributes' );
 
-		doc.selection.fire( 'update' );
+		doc.selection.fire( 'change:range' );
 
 		expect( doc.selection._updateAttributes.called ).to.be.true;
 	} );