Skip to content

Commit

Permalink
Merge pull request #75 from vkapartzianis/master
Browse files Browse the repository at this point in the history
Support Shiny (Bootstrap) tabs
  • Loading branch information
bwlewis committed Feb 23, 2018
2 parents 76a357b + 32e175f commit 72d4ab3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions inst/htmlwidgets/scatterplotThree.js
Expand Up @@ -177,6 +177,19 @@ Widget.scatter = function(w, h)
_this.controls.handleResize();
_this.animate();
});

// ...and the same for bootstrap tabs
$('.nav-tabs a').on('shown.bs.tab', function(event){
if (event.target.hash == '#'+$(el).closest('.tab-pane')[0].id) {
_this.width = _this.el.offsetWidth;
_this.height = _this.el.offsetHeight;
_this.camera.aspect = _this.width / _this.height;
_this.camera.updateProjectionMatrix();
_this.renderer.setSize(_this.width, _this.height);
_this.controls.handleResize();
_this.animate();
}
});
}

el.onmousemove = function(ev)
Expand Down

0 comments on commit 72d4ab3

Please sign in to comment.