|
|
@@ -3353,7 +3353,7 @@ describe( 'ListEngine', () => {
|
|
|
|
|
|
setModelData( modelDoc, '<listItem indent="0" type="bulleted"></listItem>' );
|
|
|
|
|
|
- modelDoc.batch().setAttribute( modelRoot.getChild( 0 ), 'type', 'numbered' );
|
|
|
+ modelDoc.batch().setAttribute( 'type', 'numbered', modelRoot.getChild( 0 ) );
|
|
|
|
|
|
expect( getViewData( editor.editing.view, { withoutSelection: true } ) ).to.equal( '<ul><li></li></ul>' );
|
|
|
} );
|
|
|
@@ -3365,7 +3365,7 @@ describe( 'ListEngine', () => {
|
|
|
|
|
|
setModelData( modelDoc, '<listItem indent="0" type="bulleted">a</listItem><listItem indent="0" type="bulleted">b</listItem>' );
|
|
|
|
|
|
- modelDoc.batch().setAttribute( modelRoot.getChild( 1 ), 'indent', 1 );
|
|
|
+ modelDoc.batch().setAttribute( 'indent', 1, modelRoot.getChild( 1 ) );
|
|
|
|
|
|
expect( getViewData( editor.editing.view, { withoutSelection: true } ) ).to.equal( '<ul><li>a</li><li>b</li></ul>' );
|
|
|
} );
|
|
|
@@ -3411,7 +3411,7 @@ describe( 'ListEngine', () => {
|
|
|
.to.equal( '<ul><li>Foo<span></span></li><li>Bar</li></ul>' );
|
|
|
|
|
|
// Change indent of the second list item.
|
|
|
- modelDoc.batch().setAttribute( modelRoot.getChild( 1 ), 'indent', 1 );
|
|
|
+ modelDoc.batch().setAttribute( 'indent', 1, modelRoot.getChild( 1 ) );
|
|
|
|
|
|
// Check if the new <ul> was added at correct position.
|
|
|
expect( getViewData( editor.editing.view, { withoutSelection: true } ) )
|
|
|
@@ -3536,7 +3536,7 @@ describe( 'ListEngine', () => {
|
|
|
const newType = element.getAttribute( 'type' ) == 'numbered' ? 'bulleted' : 'numbered';
|
|
|
|
|
|
modelDoc.enqueueChanges( () => {
|
|
|
- modelDoc.batch().setAttribute( modelDoc.selection.getFirstRange(), 'type', newType );
|
|
|
+ modelDoc.batch().setAttribute( 'type', newType, modelDoc.selection.getFirstRange() );
|
|
|
} );
|
|
|
};
|
|
|
|
|
|
@@ -3551,8 +3551,8 @@ describe( 'ListEngine', () => {
|
|
|
const batch = modelDoc.batch();
|
|
|
|
|
|
batch.rename( element, 'paragraph' );
|
|
|
- batch.removeAttribute( element, 'type' );
|
|
|
- batch.removeAttribute( element, 'indent' );
|
|
|
+ batch.removeAttribute( 'type', element );
|
|
|
+ batch.removeAttribute( 'indent', element );
|
|
|
} );
|
|
|
};
|
|
|
|
|
|
@@ -3566,8 +3566,7 @@ describe( 'ListEngine', () => {
|
|
|
modelDoc.enqueueChanges( () => {
|
|
|
const batch = modelDoc.batch();
|
|
|
|
|
|
- batch.setAttribute( element, 'type', 'bulleted' );
|
|
|
- batch.setAttribute( element, 'indent', newIndent );
|
|
|
+ batch.setAttributes( { type: 'bulleted', indent: newIndent }, element );
|
|
|
batch.rename( element, 'listItem' );
|
|
|
} );
|
|
|
};
|
|
|
@@ -3578,7 +3577,7 @@ describe( 'ListEngine', () => {
|
|
|
function testChangeIndent( testName, newIndent, input, output ) {
|
|
|
const actionCallback = () => {
|
|
|
modelDoc.enqueueChanges( () => {
|
|
|
- modelDoc.batch().setAttribute( modelDoc.selection.getFirstRange(), 'indent', newIndent );
|
|
|
+ modelDoc.batch().setAttribute( 'indent', newIndent, modelDoc.selection.getFirstRange() );
|
|
|
} );
|
|
|
};
|
|
|
|