Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonLi8 committed Jul 31, 2020
1 parent 6eb7038 commit 4d2e49b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
21 changes: 11 additions & 10 deletions js/common/view/CollisionLabScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,6 @@ class CollisionLabScreenView extends ScreenView {
centerY: elapsedTimeNumberDisplay.centerY
} );

// Reset All Button
const resetAllButton = new ResetAllButton( {
listener: () => {
model.reset();
viewProperties.reset();
},
right: this.layoutBounds.maxX - CollisionLabConstants.SCREEN_VIEW_X_MARGIN,
bottom: this.layoutBounds.maxY - CollisionLabConstants.SCREEN_VIEW_Y_MARGIN
} );

//----------------------------------------------------------------------------------------

// KeypadDialog
Expand Down Expand Up @@ -198,6 +188,17 @@ class CollisionLabScreenView extends ScreenView {
top: controlPanel.bottom + 8
} );

// Reset All Button
const resetAllButton = new ResetAllButton( {
listener: () => {
model.reset();
viewProperties.reset();
momentaDiagram.reset();
},
right: this.layoutBounds.maxX - CollisionLabConstants.SCREEN_VIEW_X_MARGIN,
bottom: this.layoutBounds.maxY - CollisionLabConstants.SCREEN_VIEW_Y_MARGIN
} );

//----------------------------------------------------------------------------------------

// Set the children in the correct rendering order.
Expand Down
15 changes: 14 additions & 1 deletion js/common/view/MomentaDiagramAccordionBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class MomentaDiagramAccordionBox extends AccordionBox {
- options.titleXSpacing
- options.titleXMargin;


//----------------------------------------------------------------------------------------

// Compute the view Bounds of the GridNode.
Expand Down Expand Up @@ -209,8 +210,20 @@ class MomentaDiagramAccordionBox extends AccordionBox {
],
clipArea: Shape.bounds( gridViewBounds )
} );

super( contentNode, options );

// @private {Property.<number>} - for resetting.
this.zoomProperty = zoomProperty;
}

/**
* Resets the MomentaDiagramAccordionBox.
* @public
*
* Called when the reset-all button is pressed.
*/
reset() {
this.zoomProperty.reset();
}
}

Expand Down

0 comments on commit 4d2e49b

Please sign in to comment.