Explorar el Código

Renamed attribute operation type from 'attr' to 'attribute'.

Piotr Jasiun hace 9 años
padre
commit
7254955e00

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

@@ -203,22 +203,22 @@ export default class Document {
 	 * * 'remove' when nodes are removed,
 	 * * 'reinsert' when remove is undone,
 	 * * 'move' when nodes are moved,
-	 * * 'attr' when attributes change.
+	 * * 'attribute' when attributes change. TODO attribute
 	 *
 	 * Change event is fired after the change is done. This means that any ranges or positions passed in
 	 * `changeInfo` are referencing nodes and paths in updated tree model.
 	 *
 	 * @event change
-	 * @param {String} type Change type, possible option: 'insert', 'remove', 'reinsert', 'move', 'attr'.
+	 * @param {String} type Change type, possible option: 'insert', 'remove', 'reinsert', 'move', 'attribute'.
 	 * @param {Object} changeInfo Additional information about the change.
 	 * @param {treeModel.Range} changeInfo.range Range containing changed nodes. Note that for 'remove' the range will be in the
 	 * {@link #graveyard graveyard root}.
 	 * @param {treeModel.Position} [changeInfo.sourcePosition] Change source position. Exists for 'remove', 'reinsert' and 'move'.
 	 * Note that for 'reinsert' the source position will be in the {@link #graveyard graveyard root}.
-	 * @param {String} [changeInfo.key] Only for 'attr' type. Key of changed / inserted / removed attribute.
-	 * @param {*} [changeInfo.oldValue] Only for 'attr' type. If the type is 'attr' and `oldValue`
+	 * @param {String} [changeInfo.key] Only for 'attribute' type. Key of changed / inserted / removed attribute.
+	 * @param {*} [changeInfo.oldValue] Only for 'attribute' type. If the type is 'attribute' and `oldValue`
 	 * is `undefined` it means that new attribute was inserted. Otherwise it contains changed or removed attribute value.
-	 * @param {*} [changeInfo.newValue] Only for 'attr' type. If the type is 'attr' and `newValue`
+	 * @param {*} [changeInfo.newValue] Only for 'attribute' type. If the type is 'attribute' and `newValue`
 	 * is `undefined` it means that attribute was removed. Otherwise it contains changed or inserted attribute value.
 	 * @param {treeModel.Batch} {@link treeModel.Batch} of changes which this change is a part of.
 	 */

+ 1 - 1
packages/ckeditor5-engine/src/treemodel/operation/attributeoperation.js

@@ -74,7 +74,7 @@ export default class AttributeOperation extends Operation {
 	}
 
 	get type() {
-		return 'attr';
+		return 'attribute';
 	}
 
 	/**

+ 3 - 3
packages/ckeditor5-engine/tests/treemodel/document/change-event.js

@@ -116,7 +116,7 @@ describe( 'Document change event', () => {
 		);
 
 		expect( changes ).to.have.length( 1 );
-		expect( types[ 0 ] ).to.equal( 'attr' );
+		expect( types[ 0 ] ).to.equal( 'attribute' );
 		expect( changes[ 0 ].range ).to.deep.equal( Range.createFromParentsAndOffsets( root, 0, root, 3 ) );
 		expect( changes[ 0 ].key ).to.equal( 'key' );
 		expect( changes[ 0 ].oldValue ).to.be.null;
@@ -138,7 +138,7 @@ describe( 'Document change event', () => {
 		);
 
 		expect( changes ).to.have.length( 1 );
-		expect( types[ 0 ] ).to.equal( 'attr' );
+		expect( types[ 0 ] ).to.equal( 'attribute' );
 		expect( changes[ 0 ].range ).to.deep.equal( Range.createFromParentsAndOffsets( root, 0, elem, 0 ) );
 		expect( changes[ 0 ].key ).to.equal( 'key' );
 		expect( changes[ 0 ].oldValue ).to.equal( 'old' );
@@ -160,7 +160,7 @@ describe( 'Document change event', () => {
 		);
 
 		expect( changes ).to.have.length( 1 );
-		expect( types[ 0 ] ).to.equal( 'attr' );
+		expect( types[ 0 ] ).to.equal( 'attribute' );
 		expect( changes[ 0 ].range ).to.deep.equal( Range.createFromParentsAndOffsets( root, 0, elem, 0 ) );
 		expect( changes[ 0 ].key ).to.equal( 'key' );
 		expect( changes[ 0 ].oldValue ).to.equal( 'old' );

+ 1 - 1
packages/ckeditor5-engine/tests/treemodel/operation/attributeoperation.js

@@ -32,7 +32,7 @@ describe( 'AttributeOperation', () => {
 			doc.version
 		);
 
-		expect( op.type ).to.equal( 'attr' );
+		expect( op.type ).to.equal( 'attribute' );
 	} );
 
 	it( 'should insert attribute to the set of nodes', () => {