浏览代码

Aligned code to with new Batch#setAttributes API.

Oskar Wróbel 8 年之前
父节点
当前提交
3c2b2613f2
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2 2
      packages/ckeditor5-link/src/linkcommand.js
  2. 1 1
      packages/ckeditor5-link/src/unlinkcommand.js

+ 2 - 2
packages/ckeditor5-link/src/linkcommand.js

@@ -69,7 +69,7 @@ export default class LinkCommand extends Command {
 					// Then update `linkHref` value.
 					const linkRange = findLinkRange( selection.getFirstPosition(), selection.getAttribute( 'linkHref' ) );
 
-					batch.setAttribute( linkRange, 'linkHref', href );
+					batch.setAttribute( 'linkHref', href, linkRange );
 
 					// Create new range wrapping changed link.
 					selection.setRanges( [ linkRange ] );
@@ -93,7 +93,7 @@ export default class LinkCommand extends Command {
 				const ranges = doc.schema.getValidRanges( selection.getRanges(), 'linkHref' );
 
 				for ( const range of ranges ) {
-					batch.setAttribute( range, 'linkHref', href );
+					batch.setAttribute( 'linkHref', href, range );
 				}
 			}
 		} );

+ 1 - 1
packages/ckeditor5-link/src/unlinkcommand.js

@@ -45,7 +45,7 @@ export default class UnlinkCommand extends Command {
 
 			// Remove `linkHref` attribute from specified ranges.
 			for ( const range of rangesToUnlink ) {
-				batch.removeAttribute( range, 'linkHref' );
+				batch.removeAttribute( 'linkHref', range );
 			}
 		} );
 	}