mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-07 03:00:20 -04:00
Rename 'style' to 'type'
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
#' \code{removeNotification}. If not provided, one will be generated
|
||||
#' automatically. If an ID is provided and there does not currently exist a
|
||||
#' notification with that ID, a new notification will be created with that ID.
|
||||
#' @param style A string which controls the color of the notification. One of
|
||||
#' @param type A string which controls the color of the notification. One of
|
||||
#' "default" (gray), "message" (blue), "warning" (yellow), or "error" (red).
|
||||
#' @param session Session object to send notification to.
|
||||
#'
|
||||
@@ -62,7 +62,7 @@
|
||||
#' }
|
||||
#' @export
|
||||
showNotification <- function(ui, duration = 5, closeButton = TRUE,
|
||||
id = NULL, style = c("default", "message", "warning", "error"),
|
||||
id = NULL, type = c("default", "message", "warning", "error"),
|
||||
session = getDefaultReactiveDomain())
|
||||
{
|
||||
|
||||
@@ -75,7 +75,7 @@ showNotification <- function(ui, duration = 5, closeButton = TRUE,
|
||||
duration = if (!is.null(duration)) duration * 1000,
|
||||
closeButton = closeButton,
|
||||
id = id,
|
||||
style = match.arg(style)
|
||||
type = match.arg(type)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ exports.notifications = (function() {
|
||||
const fadeDuration = 250;
|
||||
|
||||
function show({ html=null, duration=5000, id=null, closeButton=true,
|
||||
style = null } = {})
|
||||
type=null } = {})
|
||||
{
|
||||
if (!id)
|
||||
id = randomId();
|
||||
@@ -34,8 +34,8 @@ exports.notifications = (function() {
|
||||
$notification.removeClass(classes);
|
||||
|
||||
// Add class. 'default' means no additional CSS class.
|
||||
if (style && style !== 'default')
|
||||
$notification.addClass('shiny-notification-' + style);
|
||||
if (type && type !== 'default')
|
||||
$notification.addClass('shiny-notification-' + type);
|
||||
|
||||
|
||||
// Make sure that the presence/absence of close button matches with value
|
||||
|
||||
Reference in New Issue
Block a user