Skip to content

Commit

Permalink
improve show r code popup
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhav committed Oct 4, 2024
1 parent 3d04cc6 commit d441543
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 18 deletions.
5 changes: 4 additions & 1 deletion R/standard_layout.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ standard_layout <- function(output,
if (is.null(forms)) {
NULL
} else {
forms
tags$div(
tags$br(),
forms
)
}
)
),
Expand Down
36 changes: 19 additions & 17 deletions R/verbatim_popup.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,30 +116,32 @@ button_click_observer <- function(click_event,
handlerExpr = {
req(modal_content())
shiny::showModal(
shiny::modalDialog(
shiny::tagList(
include_css_files(pattern = "verbatim_popup"),
div(
class = "teal-widgets button-click-observer",
shiny::modalDialog(
tags$div(
tags$div(
shiny::actionButton(
paste0(copy_button_id, 1),
"Copy to Clipboard",
onclick = paste0("copyToClipboard('", copied_area_id, "')")
),
shiny::modalButton("Dismiss")
),
tags$pre(id = copied_area_id, modal_content()),
),
title = modal_title,
footer = shiny::tagList(
shiny::actionButton(
paste0(copy_button_id, 1),
paste0(copy_button_id, 2),
"Copy to Clipboard",
onclick = paste0("copyToClipboard('", copied_area_id, "')")
),
shiny::modalButton("Dismiss")
),
tags$pre(id = copied_area_id, modal_content()),
),
title = modal_title,
footer = shiny::tagList(
shiny::actionButton(
paste0(copy_button_id, 2),
"Copy to Clipboard",
onclick = paste0("copyToClipboard('", copied_area_id, "')")
),
shiny::modalButton("Dismiss")
),
size = "l",
easyClose = TRUE
size = "l",
easyClose = TRUE
)
)
)
}
Expand Down
9 changes: 9 additions & 0 deletions inst/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,12 @@
> .sidebar-content {
padding-top: 2rem;
}


.teal-widgets.button-click-observer .modal-header {
--bs-modal-header-padding: 1rem;
}

.teal-widgets.button-click-observer .modal-body {
padding: 0 1.5rem;
}

0 comments on commit d441543

Please sign in to comment.