Created
July 2, 2013 21:25
-
-
Save jcheng5/5913297 to your computer and use it in GitHub Desktop.
Bootstrap style help popup for Shiny apps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
helpPopup <- function(title, content, | |
placement=c('right', 'top', 'left', 'bottom'), | |
trigger=c('click', 'hover', 'focus', 'manual')) { | |
tagList( | |
singleton( | |
tags$head( | |
tags$script("$(function() { $(\"[data-toggle='popover']\").popover(); })") | |
) | |
), | |
tags$a( | |
href = "#", class = "btn btn-mini", `data-toggle` = "popover", | |
title = title, `data-content` = content, `data-animation` = TRUE, | |
`data-placement` = match.arg(placement, several.ok=TRUE)[1], | |
`data-trigger` = match.arg(trigger, several.ok=TRUE)[1], | |
tags$i(class="icon-question-sign") | |
) | |
) | |
} |
I can't get the helpPopup to display HTML either. helpPopup(title=NULL,content=HTML("I like <b>pie</b>.")
just displays plain text: I like <b>pie</b>.
instead of I like pie.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does anyone have an idea how to use the function when calling it in the server.R inside renderUI and calling it in the ui.R with uiOutput? Thanks