1

I've been looking around, and the documentation I found says they added a footer and button.close argument to the bsmodal function, but it doesn't seem to work. Does anybody know how to remove (or even just alter) the close button, and/or remove the whole footer part of the bsmodal popup?

Here's a working test app. I added a few css elements in case somebody might be interested in seeing that applied (I use the adjustments in my own actual app)

Info was found here : if I apply this as in the example, it just prints false in the popup.

library(shiny)
library(shinyBS)

server <- function(input, output){

  }

ui <- fluidPage(
  fluidRow(
    actionButton(inputId = "test", label = "test", style = "background-color:red")

  ),

  bsModal(id = "AppZoom", 
          title = div(HTML('<span style="color:white; font-size: 40px; font-weight:bold; font-family:sans-serif ">Zoom Factor App<span>')), 
          actionButton(inputId = "Abutton", label = "SOMEBUTTON", style = "background-color:red"),
          trigger = "test", 
          size = "small", 
          footer = NULL, close.button = FALSE
  ),
  tags$head(tags$style(HTML(".modal-body {padding: 10px} 
                                       .modal-content  {-webkit-border-radius: 6px !important;-moz-border-radius: 6px !important;border-radius: 6px !important;}
                            .modal-sm { width: 380px;}
                            .modal-header {background-color: #3c8dbc; border-top-left-radius: 6px; border-top-right-radius: 6px}
                            .modal { text-align: right; padding-right: 20px; padding-top: 24px;} 
                            .modal-dialog { display: inline-block; text-align: left; vertical-align: top;} ")))

)
shinyApp(ui = ui, server = server)
Mark
  • 2,789
  • 1
  • 26
  • 66
  • Looks like this is the relevant code to check out what is going on behind the scenes: https://github.com/ebailey78/shinyBS/blob/shinyBS3/R/bsModal.R – Dason Jul 26 '17 at 17:05
  • I did, didn't get much wiser. I tried to copy that code and modify it to make my own bsModal2 function, but that spits out an error about the last html dependency not being found. – Mark Jul 26 '17 at 17:19
  • Did you install the latest version from github or were you installing from CRAN? – Dason Jul 27 '17 at 02:49

2 Answers2

3

You could also use CSS to set the display property of the footer to 'none':

bsModal('boxPopUp1', 'test','test'),
tags$head(tags$style("#boxPopUp1 .modal-footer{ display:none}"))

Hope this helps!

Florian
  • 24,425
  • 4
  • 49
  • 80
0

It seems that to enable that functionality you need to install the last version of shinyBS from GitHub, install it using:

install.packages("devtools")
devtools::install_github("ebailey78/shinyBS")

Please note that it could be a unstable version, so be careful.

Geovany
  • 5,389
  • 21
  • 37
  • Just tried it after installing this version, and the required restart. Now I don't get a bsModal popup at all anymore. So went back to CRAN version, and it works again with footer – Mark Jul 27 '17 at 11:07