Browse Source

Refactor createAttributeElement call to one line.

Maciej Gołaszewski 6 years ago
parent
commit
0af219a530
1 changed files with 3 additions and 7 deletions
  1. 3 7
      packages/ckeditor5-link/src/linkediting.js

+ 3 - 7
packages/ckeditor5-link/src/linkediting.js

@@ -156,14 +156,10 @@ export default class LinkEditing extends Plugin {
 				model: decorator.id,
 				view: ( manualDecoratorName, writer ) => {
 					if ( manualDecoratorName ) {
-						const element = writer.createAttributeElement(
-							'a',
-							manualDecorators.get( decorator.id ).attributes,
-							{
-								priority: 5
-							}
-						);
+						const attributes = manualDecorators.get( decorator.id ).attributes;
+						const element = writer.createAttributeElement( 'a', attributes, { priority: 5 } );
 						writer.setCustomProperty( 'link', true, element );
+
 						return element;
 					}
 				} } );