8
0
Просмотр исходного кода

Changed: Rename `DropdownButtonInterface#select` event to `#open`.

Maciej Gołaszewski 8 лет назад
Родитель
Сommit
68116d3a24

+ 1 - 1
packages/ckeditor5-ui/src/dropdown/button/dropdownbuttoninterface.jsdoc

@@ -17,5 +17,5 @@
 /**
  * Fired when the arrow view is clicked. It won't be fired when the button {@link #isEnabled} is `false`.
  *
- * @event select
+ * @event open
  */

+ 2 - 2
packages/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js

@@ -47,8 +47,8 @@ export default class DropdownButtonView extends ButtonView {
 		 */
 		this.arrowView = this._createArrowView();
 
-		// Dropdown expects "select" event on button view upon which the dropdown will open.
-		this.delegate( 'execute' ).to( this, 'select' );
+		// Dropdown expects "open" event on button view upon which the dropdown will open.
+		this.delegate( 'execute' ).to( this, 'open' );
 
 		/**
 		 * Fired when the view is clicked. It won't be fired when the button {@link #isEnabled} is `false`.

+ 1 - 1
packages/ckeditor5-ui/src/dropdown/button/splitbuttonview.js

@@ -250,7 +250,7 @@ export default class SplitButtonView extends View {
 
 		arrowView.bind( 'isEnabled' ).to( this );
 
-		arrowView.delegate( 'execute' ).to( this, 'select' );
+		arrowView.delegate( 'execute' ).to( this, 'open' );
 
 		return arrowView;
 	}

+ 2 - 2
packages/ckeditor5-ui/src/dropdown/dropdownview.js

@@ -172,8 +172,8 @@ export default class DropdownView extends View {
 	render() {
 		super.render();
 
-		// Toggle the the dropdown when its button has been clicked.
-		this.listenTo( this.buttonView, 'select', () => {
+		// Toggle the dropdown when its button has been clicked.
+		this.listenTo( this.buttonView, 'open', () => {
 			this.isOpen = !this.isOpen;
 		} );
 

+ 2 - 2
packages/ckeditor5-ui/tests/dropdown/button/dropdownbuttonview.js

@@ -34,10 +34,10 @@ describe( 'DropdownButtonView', () => {
 	} );
 
 	describe( 'bindings', () => {
-		it( 'delegates view#execute to view#select', () => {
+		it( 'delegates view#execute to view#open', () => {
 			const spy = sinon.spy();
 
-			view.on( 'select', spy );
+			view.on( 'open', spy );
 
 			view.fire( 'execute' );
 

+ 2 - 2
packages/ckeditor5-ui/tests/dropdown/button/splitbuttonview.js

@@ -150,10 +150,10 @@ describe( 'SplitButtonView', () => {
 			expect( view.actionView.label ).to.equal( 'foo' );
 		} );
 
-		it( 'delegates arrowView#execute to view#select', () => {
+		it( 'delegates arrowView#execute to view#open', () => {
 			const spy = sinon.spy();
 
-			view.on( 'select', spy );
+			view.on( 'open', spy );
 
 			view.arrowView.fire( 'execute' );
 

+ 3 - 3
packages/ckeditor5-ui/tests/dropdown/dropdownview.js

@@ -72,9 +72,9 @@ describe( 'DropdownView', () => {
 						values.push( view.isOpen );
 					} );
 
-					view.buttonView.fire( 'select' );
-					view.buttonView.fire( 'select' );
-					view.buttonView.fire( 'select' );
+					view.buttonView.fire( 'open' );
+					view.buttonView.fire( 'open' );
+					view.buttonView.fire( 'open' );
 
 					expect( values ).to.have.members( [ true, false, true ] );
 				} );