Browse Source

Changed setHighlight to addHighlight.

Szymon Kupś 8 years ago
parent
commit
d88bbb3712

+ 2 - 2
packages/ckeditor5-widget/src/utils.js

@@ -42,7 +42,7 @@ export function isWidget( element ) {
  * * adds custom `getFillerOffset` method returning `null`,
  * * adds `ck-widget` CSS class,
  * * adds custom property allowing to recognize widget elements by using {@link ~isWidget},
- * * implements `setHighlight` and `removeHighlight` custom properties to handle view highlight on widgets.
+ * * implements `addHighlight` and `removeHighlight` custom properties to handle view highlight on widgets.
  *
  * @param {module:engine/view/element~Element} element
  * @param {Object} [options={}]
@@ -90,7 +90,7 @@ export function setHighlightHandling( element, add, remove ) {
 		}
 	} );
 
-	element.setCustomProperty( 'setHighlight', ( element, descriptor ) => stack.add( descriptor ) );
+	element.setCustomProperty( 'addHighlight', ( element, descriptor ) => stack.add( descriptor ) );
 	element.setCustomProperty( 'removeHighlight', ( element, descriptor ) => stack.remove( descriptor ) );
 }
 

+ 3 - 3
packages/ckeditor5-widget/tests/utils.js

@@ -53,7 +53,7 @@ describe( 'widget utils', () => {
 		it( 'should set default highlight handling methods', () => {
 			toWidget( element );
 
-			const set = element.getCustomProperty( 'setHighlight' );
+			const set = element.getCustomProperty( 'addHighlight' );
 			const remove = element.getCustomProperty( 'removeHighlight' );
 
 			expect( typeof set ).to.equal( 'function' );
@@ -137,7 +137,7 @@ describe( 'widget utils', () => {
 		} );
 	} );
 
-	describe( 'setHighlightHandling()', () => {
+	describe( 'addHighlightHandling()', () => {
 		let element, addSpy, removeSpy, set, remove;
 
 		beforeEach( () => {
@@ -146,7 +146,7 @@ describe( 'widget utils', () => {
 			removeSpy = sinon.spy();
 
 			setHighlightHandling( element, addSpy, removeSpy );
-			set = element.getCustomProperty( 'setHighlight' );
+			set = element.getCustomProperty( 'addHighlight' );
 			remove = element.getCustomProperty( 'removeHighlight' );
 		} );