From 9b72cbd5f7dc092578ff6557a8ef18ad27a9b212 Mon Sep 17 00:00:00 2001 From: Barbara Borges Ribeiro Date: Fri, 3 Mar 2017 04:39:28 +0000 Subject: [PATCH 1/4] Closes #129: Trigger shown/hidden event for Shiny outputs in the sidebar --- inst/shinydashboard.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inst/shinydashboard.js b/inst/shinydashboard.js index b41c31bd..35f2710f 100644 --- a/inst/shinydashboard.js +++ b/inst/shinydashboard.js @@ -61,6 +61,10 @@ $(function() { $(window).trigger("resize"); }); + $(document).on("click", "a[href^='#shiny-tab']", function() { + $(this).next().trigger("shown"); + }); + // menuOutputBinding // ------------------------------------------------------------------ // Based on Shiny.htmlOutputBinding, but instead of putting the result in a From 7a5a013ee1eb7a1310ae3c256eae2b9167349944 Mon Sep 17 00:00:00 2001 From: Barbara Borges Ribeiro Date: Fri, 3 Mar 2017 04:55:55 +0000 Subject: [PATCH 2/4] do not require menuItems to have a tabName --- inst/shinydashboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/shinydashboard.js b/inst/shinydashboard.js index 35f2710f..606cb313 100644 --- a/inst/shinydashboard.js +++ b/inst/shinydashboard.js @@ -61,7 +61,7 @@ $(function() { $(window).trigger("resize"); }); - $(document).on("click", "a[href^='#shiny-tab']", function() { + $(document).on("click", ".treeview > a", function() { $(this).next().trigger("shown"); }); From 76fafc41e4bc6af48fda0b7277a3ce81abed3497 Mon Sep 17 00:00:00 2001 From: Barbara Borges Ribeiro Date: Mon, 6 Mar 2017 18:46:32 +0000 Subject: [PATCH 3/4] add NEWS item --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index a71b6826..8f055dee 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,8 @@ shinydashboard 0.5.3.9000 ========================= +* Fixed [#129](https://github.com/rstudio/shinydashboard/issues/129): Trigger shown/hidden event for Shiny outputs in the sidebar. ([#194](https://github.com/rstudio/shinydashboard/pull/194)) + * Fixed [#73](https://github.com/rstudio/shinydashboard/issues/73): add `collapsed` argument to `dashboardSidebar()`, which allows it to start off collapsed. ([#186](https://github.com/rstudio/shinydashboard/pull/186)) * 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) From 1d67c517603db5a97266ad2100e6ac56fda1d9c8 Mon Sep 17 00:00:00 2001 From: Barbara Borges Ribeiro Date: Mon, 6 Mar 2017 18:49:15 +0000 Subject: [PATCH 4/4] Winston's feedback --- inst/shinydashboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/shinydashboard.js b/inst/shinydashboard.js index 606cb313..c9b6db1d 100644 --- a/inst/shinydashboard.js +++ b/inst/shinydashboard.js @@ -62,7 +62,7 @@ $(function() { }); $(document).on("click", ".treeview > a", function() { - $(this).next().trigger("shown"); + $(this).next(".treeview-menu").trigger("shown"); }); // menuOutputBinding