Skip to content

Commit

Permalink
Merge pull request #11 from floryst/activate_clicked_views
Browse files Browse the repository at this point in the history
fix(Layout): Activate views when clicked
  • Loading branch information
jourdain authored Feb 13, 2018
2 parents d8661d2 + dd8b15e commit 712d0e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/layouts/Layout2D.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export default class Layout2D extends React.Component {
this.view.resetCamera();

setTimeout(this.view.resize, 500);

// set mousedown capture on containers after view.setContainer.
this.container.addEventListener('mousedown', this.activateView, true);
this.sliderContainer.addEventListener('mousedown', this.activateView, true);
}

componentWillUnmount() {
Expand Down
3 changes: 3 additions & 0 deletions Sources/layouts/Layout3D.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export default class Layout3D extends React.Component {
this.view.resetCamera();

setTimeout(this.view.resize, 500);

// set mousedown capture on container after view.setContainer.
this.container.addEventListener('mousedown', this.activateView, true);
}

componentWillUnmount() {
Expand Down

0 comments on commit 712d0e7

Please sign in to comment.