Skip to content

Commit a3a0a2e

Browse files
bborgesrdmpe
authored andcommitted
Fix #62: make images resize when the sidebar collapses/expands (#185)
1 parent 61c3f8a commit a3a0a2e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
shinydashboard 0.5.3.9000
22
=========================
33

4+
* Fixed [#62](https://github.com/rstudio/shinydashboard/issues/62): make images resize when the sidebar collapses/expands. [#185](https://github.com/rstudio/shinydashboard/pull/185)
5+
46
* Addressed [#178](https://github.com/rstudio/shinydashboard/issues/178): switch from `npm` to `yarn`. Also upgraded all yarn packages to the `latest` tag (all major changes). [#184](https://github.com/rstudio/shinydashboard/pull/184)
57

68
* Fixed [#176](https://github.com/rstudio/shinydashboard/issues/176) (making buttons look good on the sidebar) by giving Shiny action buttons and links some margin space. ([#182](https://github.com/rstudio/shinydashboard/pull/182))

inst/shinydashboard.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ $(function() {
5555
$(".navbar > .sidebar-toggle").hide();
5656
}
5757

58+
// Trigger the resize event when the sidebar is collapsed/expanded
59+
// (this allows images to be responsive and resize themselves)
60+
$(document).on("click", ".sidebar-toggle", function() {
61+
$(window).trigger("resize");
62+
});
5863

5964
// menuOutputBinding
6065
// ------------------------------------------------------------------

0 commit comments

Comments
 (0)