Skip to content

Instantly share code, notes, and snippets.

@RAPLER
Forked from jcheng5/helpPopup.R
Last active October 27, 2016 13:34
Show Gist options
  • Save RAPLER/a84f5d3896356c5a09eb to your computer and use it in GitHub Desktop.
Save RAPLER/a84f5d3896356c5a09eb to your computer and use it in GitHub Desktop.
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")
)
)
}
@cscheeder
Copy link

Thank you fot this nice function, generally works perfectly fine. Are there changes in the code required when setting the function within the server.R using renderUI and calling it in the ui.R with uiOutput? I get the boostrap symbol however the popup text is not shown following the described approach... I am not really familiar with js so I would appreciate any help. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment