Rename 'style' to 'type'

This commit is contained in:
Winston Chang
2016-03-23 14:00:51 -05:00
parent 0d6754761d
commit 34068b1598
2 changed files with 6 additions and 6 deletions

View File

@@ -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)
)
)

View File

@@ -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