Skip to content

Commit

Permalink
Refactor buttonListener with FireListener. phetsims/masses-and-spring…
Browse files Browse the repository at this point in the history
  • Loading branch information
Denz1994 committed May 11, 2020
1 parent 09a56a9 commit af148e3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions js/common/view/MoleculeBondNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

import platform from '../../../../phet-core/js/platform.js';
import ButtonListener from '../../../../scenery/js/input/ButtonListener.js';
import Circle from '../../../../scenery/js/nodes/Circle.js';
import Line from '../../../../scenery/js/nodes/Line.js';
import Node from '../../../../scenery/js/nodes/Node.js';
Expand All @@ -23,6 +22,7 @@ import scissorsImage from '../../../images/scissors_png.js';
import buildAMolecule from '../../buildAMolecule.js';
import BAMConstants from '../BAMConstants.js';
import Direction from '../model/Direction.js';
import FireListener from '../../../../scenery/js/listeners/FireListener.js';

//REVIEW: Imports don't match up with the image files, I would expect to see:
//REVIEW: scissorsClosedUpImage, scissorsClosedUpImage, scissorsClosedImage, scissorsClosedImage, scissorsUpImage, scissorsUpImage, scissorsImage
Expand Down Expand Up @@ -127,9 +127,9 @@ class MoleculeBondNode extends Node {
visible: true
} ) );

//REVIEW: ButtonListener is deprecated, can we use FireListener?
cutTargetNode.addInputListener( new ButtonListener( {
down() {
cutTargetNode.addInputListener( new FireListener( {
fireOnDown: true,
fire() {
cutTargetNode.cursor = closedCursor;
kit.breakBond( bond.a, bond.b );
}
Expand Down Expand Up @@ -171,4 +171,4 @@ class MoleculeBondNode extends Node {
}

buildAMolecule.register( 'MoleculeBondNode', MoleculeBondNode );
export default MoleculeBondNode;
export default MoleculeBondNode;

0 comments on commit af148e3

Please sign in to comment.