mirror of
https://github.com/rstudio/shiny.git
synced 2026-01-10 23:48:01 -05:00
concatenate duplicate attributes in tag definitions
This commit is contained in:
2
NEWS
2
NEWS
@@ -42,7 +42,7 @@ column functions for creating arbitrary bootstrap grid layouts.
|
||||
|
||||
* Added `hr()` builder function for creating horizontal rules.
|
||||
|
||||
* Automatically concatenate multiple class attributes in tag definitions
|
||||
* Automatically concatenate duplicate attributes in tag definitions
|
||||
|
||||
|
||||
shiny 0.8.0
|
||||
|
||||
7
R/tags.R
7
R/tags.R
@@ -149,11 +149,10 @@ tagWrite <- function(tag, textWriter, indent=0, context = NULL, eol = "\n") {
|
||||
# write tag name
|
||||
textWriter(paste(indentText, "<", tag$name, sep=""))
|
||||
|
||||
# concatenate class attributes
|
||||
# concatenate attributes
|
||||
attribs <- tag$attribs
|
||||
classValue <- paste(attribs[names(attribs) == "class"], collapse=" ")
|
||||
attribs <- c(list(class = classValue), attribs[names(attribs) != "class"])
|
||||
|
||||
attribs <- lapply(split(attribs, names(attribs)), paste, collapse = " ")
|
||||
|
||||
# write attributes
|
||||
for (attrib in names(attribs)) {
|
||||
attribValue <- attribs[[attrib]]
|
||||
|
||||
Reference in New Issue
Block a user