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

resizable and toggle does not work in 0.3.1 #28

Closed
zetp opened this issue Jul 24, 2018 · 2 comments
Closed

resizable and toggle does not work in 0.3.1 #28

zetp opened this issue Jul 24, 2018 · 2 comments

Comments

@zetp
Copy link

zetp commented Jul 24, 2018

Hi,
after update via CRAN from 0.3.0 to 0.3.1 functions jqui_resizable and jqui_toggle stopped working. There is no error in R console but you cannot resize element and toggle visibility.

The code below works with 0.3.0 but not with 0.3.1 [R version 3.5.0, shiny_1.1.0]

library(shiny)
library(shinyjqui)

# Define UI for application that draws a histogram
ui <- fluidPage(
   
   # Application title
   titlePanel("Old Faithful Geyser Data"),
   
   # Sidebar with a slider input for number of bins 
   sidebarLayout(
      sidebarPanel(
         sliderInput("bins",
                     "Number of bins:",
                     min = 1,
                     max = 50,
                     value = 30),
         actionButton(inputId = "toggle", label = "hide")
      ),
      
      # Show a plot of the generated distribution
      mainPanel(
        jqui_resizable(plotOutput("distPlot")),
        uiOutput("jqui")
      )
   )
)

# Define server logic required to draw a histogram
server <- function(input, output) {
   
   output$distPlot <- renderPlot({
      # generate bins based on input$bins from ui.R
      x    <- faithful[, 2] 
      bins <- seq(min(x), max(x), length.out = input$bins + 1)
      
      # draw the histogram with the specified number of bins
      hist(x, breaks = bins, col = 'darkgray', border = 'white')
   })
   
   output$jqui <- renderUI({
     ppp <- input$distPlot_size
     tags$small(paste0("current size: ",ppp$width, " x ", ppp$height))
   })
   
   observeEvent(input$toggle, {
     jqui_toggle("#bins", effect=NULL) 
   })
}

# Run the application 
shinyApp(ui = ui, server = server)
@Yang-Tang
Copy link
Owner

Hi @zetp , thank you for the bug report. I pushed a fix to github about this. jqui_toggle should work now. Could you have a try to see whether it fixed your problem?

@zetp
Copy link
Author

zetp commented Jul 25, 2018

Github version works. Many Thanks!

@zetp zetp closed this as completed Jul 25, 2018
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

No branches or pull requests

2 participants