Skip to content

Commit

Permalink
add start/end logging to all slider controls, #58
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Malley <cmalley@pixelzoom.com>
  • Loading branch information
pixelzoom committed Jun 20, 2018
1 parent cedb34a commit 6fb8295
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
10 changes: 8 additions & 2 deletions js/common/view/AppliedForceControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,14 @@ define( function( require ) {
majorTicks: majorTicks,
minorTickSpacing: MINOR_TICK_SPACING,
thumbFillEnabled: HookesLawColors.APPLIED_FORCE,
startCallback: function() { numberOfInteractionsInProgressProperty.set( numberOfInteractionsInProgressProperty.get() + 1 ); },
endCallback: function() { numberOfInteractionsInProgressProperty.set( numberOfInteractionsInProgressProperty.get() - 1 ); },
startCallback: function() {
phet.log && phet.log( 'AppliedForceControl start drag' );
numberOfInteractionsInProgressProperty.set( numberOfInteractionsInProgressProperty.get() + 1 );
},
endCallback: function() {
numberOfInteractionsInProgressProperty.set( numberOfInteractionsInProgressProperty.get() - 1 );
phet.log && phet.log( 'AppliedForceControl end drag' );
},

// phet-io
tandem: Tandem.required
Expand Down
10 changes: 8 additions & 2 deletions js/common/view/DisplacementControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,14 @@ define( function( require ) {
delta: HookesLawConstants.DISPLACEMENT_DELTA,
minorTickSpacing: 1,
thumbFillEnabled: HookesLawColors.DISPLACEMENT,
startCallback: function() { numberOfInteractionsInProgressProperty.set( numberOfInteractionsInProgressProperty.get() + 1 ); },
endCallback: function() { numberOfInteractionsInProgressProperty.set( numberOfInteractionsInProgressProperty.get() - 1 ); },
startCallback: function() {
phet.log && phet.log( 'DisplacementControl start drag' );
numberOfInteractionsInProgressProperty.set( numberOfInteractionsInProgressProperty.get() + 1 );
},
endCallback: function() {
numberOfInteractionsInProgressProperty.set( numberOfInteractionsInProgressProperty.get() - 1 );
phet.log && phet.log( 'DisplacementControl end drag' );
},
constrainValue: function( value ) {
// constrain to multiples of a specific interval, see #54
return Util.roundToInterval( value, HookesLawConstants.DISPLACEMENT_INTERVAL );
Expand Down
6 changes: 6 additions & 0 deletions js/common/view/SpringConstantControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ define( function( require ) {
delta: HookesLawConstants.SPRING_CONSTANT_DELTA,
minorTickSpacing: 100,
thumbFillEnabled: HookesLawColors.SINGLE_SPRING,
startCallback: function() {
phet.log && phet.log( 'SpringConstantControl start drag' );
},
endCallback: function() {
phet.log && phet.log( 'SpringConstantControl end drag' );
},

// phet-io
tandem: Tandem.required
Expand Down

0 comments on commit 6fb8295

Please sign in to comment.