Skip to content

Commit

Permalink
added hover state to buttons on focus/blur with keyboard, phetsims/su…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Mar 28, 2018
1 parent bfc5ef5 commit 50d0425
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions js/JoistButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ define( function( require ) {
this.addAccessibleInputListener( {
click: function() {
self.buttonModel.a11yClick( options.a11yEndListener );
},
focus: function() {
self.buttonModel.overProperty.value = true;
},
blur: function() {
self.buttonModel.overProperty.value = false;
}
} );

Expand Down
6 changes: 6 additions & 0 deletions js/NavigationBarScreenButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ define( function( require ) {
this.addAccessibleInputListener( {
click: function() {
self.buttonModel.a11yClick();
},
focus: function() {
self.buttonModel.overProperty.value = true;
},
blur: function() {
self.buttonModel.overProperty.value = false;
}
} );

Expand Down
8 changes: 8 additions & 0 deletions js/ScreenButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ define( function( require ) {
this.addInputListener( { down: downListener } );
this.addAccessibleInputListener( { click: function() { large && downListener(); } } );
this.addAccessibleInputListener( { focus: function() { !large && downListener(); } } );
this.addAccessibleInputListener( {
focus: function() {
highlightedScreenIndexProperty.value = index;
},
blur: function() {
highlightedScreenIndexProperty.value = -1;
}
} );

// Set highlight listeners to the small screen button
if ( !large ) {
Expand Down

0 comments on commit 50d0425

Please sign in to comment.