Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Changed: Rename DropdownButtonInterface#select event to #open.
Browse files Browse the repository at this point in the history
  • Loading branch information
jodator committed Feb 6, 2018
1 parent 2b0291d commit 8344775
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/dropdown/button/dropdownbuttoninterface.jsdoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
4 changes: 2 additions & 2 deletions src/dropdown/button/dropdownbuttonview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion src/dropdown/button/splitbuttonview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/dropdown/dropdownview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
} );

Expand Down
4 changes: 2 additions & 2 deletions tests/dropdown/button/dropdownbuttonview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );

Expand Down
4 changes: 2 additions & 2 deletions tests/dropdown/button/splitbuttonview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );

Expand Down
6 changes: 3 additions & 3 deletions tests/dropdown/dropdownview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ] );
} );
Expand Down

0 comments on commit 8344775

Please sign in to comment.