Ver código fonte

Make AttributeElement.DEFAULT_PRIORITY a static property.

Piotr Jasiun 9 anos atrás
pai
commit
df507071ac

+ 9 - 6
packages/ckeditor5-engine/src/treeview/attributeelement.js

@@ -8,12 +8,8 @@
 import Element from './element.js';
 import ContainerElement from './containerelement.js';
 
-/**
- * Default attribute priority.
- *
- * @member {Number} engine.treeView.AttributeElement.DEFAULT_PRIORITY
- */
-export const DEFAULT_PRIORITY = 10;
+// Default attribute priority.
+const DEFAULT_PRIORITY = 10;
 
 /**
  * Attributes are elements which define document presentation. They are mostly elements like `<b>` or `<span>`.
@@ -101,3 +97,10 @@ export default class AttributeElement extends Element {
 		return 0;
 	}
 }
+
+/**
+ * Default attribute priority.
+ *
+ * @member {Number} engine.treeView.AttributeElement.DEFAULT_PRIORITY
+ */
+AttributeElement.DEFAULT_PRIORITY = DEFAULT_PRIORITY;

+ 1 - 2
packages/ckeditor5-engine/tests/treeview/attributeelement.js

@@ -9,7 +9,6 @@
 
 import AttributeElement from '/ckeditor5/engine/treeview/attributeelement.js';
 import Element from '/ckeditor5/engine/treeview/element.js';
-import { DEFAULT_PRIORITY } from '/ckeditor5/engine/treeview/attributeelement.js';
 import { parse } from '/tests/engine/_utils/view.js';
 
 describe( 'AttributeElement', () => {
@@ -20,7 +19,7 @@ describe( 'AttributeElement', () => {
 			expect( el ).to.be.an.instanceof( AttributeElement );
 			expect( el ).to.be.an.instanceof( Element );
 			expect( el ).to.have.property( 'name' ).that.equals( 'strong' );
-			expect( el ).to.have.property( 'priority' ).that.equals( DEFAULT_PRIORITY );
+			expect( el ).to.have.property( 'priority' ).that.equals( AttributeElement.DEFAULT_PRIORITY );
 		} );
 	} );