Skip to content

Instantly share code, notes, and snippets.

@jcheng5
Created July 2, 2013 21:25
Show Gist options
  • Select an option

  • Save jcheng5/5913297 to your computer and use it in GitHub Desktop.

Select an option

Save jcheng5/5913297 to your computer and use it in GitHub Desktop.

Revisions

  1. jcheng5 created this gist Jul 2, 2013.
    19 changes: 19 additions & 0 deletions helpPopup.R
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    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")
    )
    )
    }