Skip to content

Commit

Permalink
remove duplcated accessibleInputListeners from children, phetsims/sce…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Aug 24, 2018
1 parent 82fd0e0 commit 3a2c608
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
11 changes: 0 additions & 11 deletions js/buttons/RoundStickyToggleButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ define( function( require ) {
*/
function RoundStickyToggleButton( valueUp, valueDown, property, options ) {

var self = this;

options = _.extend( {
tandem: Tandem.required,
phetioType: ToggleButtonIO,
Expand All @@ -44,21 +42,12 @@ define( function( require ) {
// Note it shares a tandem with this, so the emitter will be instrumented as a child of the button
this.toggleButtonModel = new StickyToggleButtonModel( valueUp, valueDown, property, options );
RoundButtonView.call( this, this.toggleButtonModel, new StickyToggleButtonInteractionStateProperty( this.toggleButtonModel ), options );

// @private (a11y) - toggle the button when we receive the accessible click event
this.accessibleClickListener = {
click: function( event ) {
self.toggleButtonModel.toggle();
}
};
this.addAccessibleInputListener( this.accessibleClickListener );
}

sun.register( 'RoundStickyToggleButton', RoundStickyToggleButton );

return inherit( RoundButtonView, RoundStickyToggleButton, {
dispose: function() {
this.removeAccessibleInputListener( this.accessibleClickListener );
this.toggleButtonModel.dispose(); //TODO this fails with assertions enabled, see sun#212
RoundButtonView.prototype.dispose.call( this );
}
Expand Down
11 changes: 0 additions & 11 deletions js/buttons/RoundToggleButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ define( function( require ) {
*/
function RoundToggleButton( valueOff, valueOn, property, options ) {

var self = this;

// Tandem support
options = _.extend( {
tandem: Tandem.required,
Expand All @@ -43,14 +41,6 @@ define( function( require ) {
this.toggleButtonModel = new ToggleButtonModel( valueOff, valueOn, property, options );

RoundButtonView.call( this, this.toggleButtonModel, new ToggleButtonInteractionStateProperty( this.toggleButtonModel ), options );

// @private (a11y) - toggle the button when we receive the accessible click event
this.accessibleClickListener = {
click: function( event ) {
self.toggleButtonModel.toggle();
}
};
this.addAccessibleInputListener( this.accessibleClickListener );
}

sun.register( 'RoundToggleButton', RoundToggleButton );
Expand All @@ -59,7 +49,6 @@ define( function( require ) {

// @public
dispose: function() {
this.removeAccessibleInputListener( this.accessibleClickListener );
this.toggleButtonModel.dispose(); // TODO this fails with assertions enabled, see sun#212
RoundButtonView.prototype.dispose.call( this );
}
Expand Down

0 comments on commit 3a2c608

Please sign in to comment.