-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc64bb7
commit 9a8fbd6
Showing
18 changed files
with
240 additions
and
35 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#' Close a material modal programmatically. | ||
#' | ||
#' Close a material modal programmatically (server side). | ||
#' @param session The session object passed to function given to shinyServer. | ||
#' @param modal_id String. The ID of the modal to open. | ||
#' @examples | ||
#' \dontrun{ | ||
#' close_material_modal(session, "example_modal") | ||
#' } | ||
close_material_modal <- function(session, modal_id){ | ||
|
||
js_code <- paste0("$('#", modal_id, "').modal('close');") | ||
|
||
session$sendCustomMessage( | ||
type = "shinymaterialJS", | ||
js_code | ||
) | ||
|
||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#' Change the text, icon of a material_button on the client. Allow to disable. | ||
#' | ||
#' Change the value text, icon of a material_button on the client. | ||
#' Allow to disable the button and then enable. | ||
#' @param session The session object passed to function given to shinyServer. | ||
#' @param input_id The input_id of the material_button. | ||
#' @param label The new label of the material_button. | ||
#' @param icon The new icon of the material_button. If not set, icon disappear. | ||
#' @param enable TRUE if the button is enable, FALSE if disable. | ||
#' @examples | ||
#' \dontrun{ | ||
#' update_material_button( | ||
#' session, | ||
#' input_id = "example_button", | ||
#' value = "New Text", | ||
#' icon = "stop", | ||
#' enable = FALSE | ||
#' ) | ||
#' } | ||
update_material_button <- function (session, input_id, label = NULL, icon = NULL, enable = TRUE) { | ||
|
||
js_code <- paste0("$('#", input_id, "').prop( 'disabled', ", tolower(enable), " )") | ||
session$sendCustomMessage(type = "shinymaterialJS", js_code) | ||
|
||
if (!is.null(label)){ | ||
if (!is.null(icon)) | ||
icon <- paste0('<i class="material-icons left">', icon, '</i>') | ||
js_code <- paste0("$('#", input_id, "').prop( 'innerHTML', '", icon, label, "')") | ||
session$sendCustomMessage(type = "shinymaterialJS", js_code) | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* Adapted from https://fonts.googleapis.com/icon?family=Material+Icons */ | ||
@font-face { | ||
font-family: 'Material Icons'; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: url(icons/materialicons/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2'); | ||
} | ||
|
||
.material-icons { | ||
font-family: 'Material Icons'; | ||
font-weight: normal; | ||
font-style: normal; | ||
font-size: 24px; | ||
line-height: 1; | ||
letter-spacing: normal; | ||
text-transform: none; | ||
display: inline-block; | ||
white-space: nowrap; | ||
word-wrap: normal; | ||
direction: ltr; | ||
-moz-font-feature-settings: 'liga'; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
Binary file not shown.
Binary file not shown.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.