-
Notifications
You must be signed in to change notification settings - Fork 5
/
global.R
28 lines (25 loc) · 1 KB
/
global.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
modalDialog = function(id, header = "Confirmation", body = "Are you sure?", footer = list(actionButton("confirmDlgOkBtn", "OK"))){
div(id = id, class = "modal fade",
div(class = "modal-dialog",
div(class = "modal-content",
div(class = "modal-header",
tags$button(type = "button", class = "close", 'data-dismiss' = "modal", 'aria-hidden' = "true", HTML('×')),
tags$h4(class = "modal-title", header)
),
div(class = "modal-body",
tags$p(body)
),
div(class = "modal-footer",
tagList(footer)
)
)
)
)
}
modalTriggerButton = function(inputId, target, label, icon = NULL){
if (!is.null(icon))
buttonContent <- list(icon, label)
else buttonContent <- label
tags$button(id = inputId, type = "button", class = "btn action-button btn-primary", 'data-toggle' = "modal", 'data-target' = target,
buttonContent)
}