Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #129: Trigger shown/hidden event for Shiny outputs in the sidebar #194

Merged
merged 4 commits into from
Mar 6, 2017

Conversation

bborgesr
Copy link
Contributor

@bborgesr bborgesr commented Mar 3, 2017

One thing I'm unhappy about is the jagged look of the expanded menu item when we first click it (so smooth transition, since the element actually has to be created)...

Example:

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(
    sidebarMenu(
      menuItem("Menu Item", tabName = "tab1", textOutput("text1")),
      menuItem("Menu Item", tabName = "tab2", textOutput("text2"))
    )
  ),
  dashboardBody()
)

server <- function(input, output) {
  output$text1 <- renderText("text1")
  output$text2 <- renderText("text2")
}

shinyApp(ui = ui, server = server)

@@ -61,6 +61,10 @@ $(function() {
$(window).trigger("resize");
});

$(document).on("click", ".treeview > a", function() {
$(this).next().trigger("shown");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be a little safer to use .next('.treeview-menu').

@bborgesr bborgesr merged commit 1d21267 into master Mar 6, 2017
@bborgesr bborgesr deleted the barbara/shown branch March 6, 2017 18:49
dmpe pushed a commit to dmpe/shinydashboard that referenced this pull request Mar 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants