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)
@bborgesr bborgesr added the in progress label Mar 3, 2017
@@ -61,6 +61,10 @@ $(function() {
$(window).trigger("resize");
});

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

This comment has been minimized.

@wch

wch Mar 3, 2017
Contributor

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

bborgesr added 2 commits Mar 6, 2017
@bborgesr bborgesr merged commit 1d21267 into master Mar 6, 2017
0 of 4 checks passed
0 of 4 checks passed
continuous-integration/appveyor/branch Waiting for AppVeyor build to complete
Details
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
@bborgesr bborgesr deleted the barbara/shown branch Mar 6, 2017
@bborgesr bborgesr removed the in progress label Mar 6, 2017
dmpe added 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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.