Skip to content

Commit c839734

Browse files
committed
supply config attributes _before_ adding/removing special buttons
1 parent 3e133af commit c839734

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

R/layout.R

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ rangeslider <- function(p, ...) {
6868

6969
config <- function(p, ..., collaborate = TRUE, cloud = FALSE) {
7070

71-
# make sure config is a list
72-
p$x$config <- p$x$config %||% list()
71+
p$x$config <- modify_list(p$x$config, list(...))
7372

7473
nms <- sapply(p$x$config[["modeBarButtonsToAdd"]], "[[", "name")
7574
hasCollab <- sharingButton()[["name"]] %in% nms
@@ -97,8 +96,6 @@ config <- function(p, ..., collaborate = TRUE, cloud = FALSE) {
9796
if (length(p$x$config[["modeBarButtonsToRemove"]]) == 1) {
9897
p$x$config[["modeBarButtonsToRemove"]] <- list(p$x$config[["modeBarButtonsToRemove"]])
9998
}
100-
101-
102-
p$x$config <- modify_list(p$x$config, list(...))
99+
103100
p
104101
}

0 commit comments

Comments
 (0)