Skip to content

Commit

Permalink
Revert "Return invisibly when not creating a new tagQuery() object (#228
Browse files Browse the repository at this point in the history
)"

This reverts commit 3a2757f.
  • Loading branch information
schloerke committed Apr 22, 2021
1 parent 0f95558 commit 62b2f7d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions R/tag_query.R
Original file line number Diff line number Diff line change
Expand Up @@ -723,14 +723,14 @@ tagQuery_ <- function(
addClass = function(class) {
rebuild_()
tagQueryClassAdd(selected_, class)
invisible(self)
self
},
#' * `$removeClass(class)`: Removes a set of class values from all of
#' the selected elements.
removeClass = function(class) {
rebuild_()
tagQueryClassRemove(selected_, class)
invisible(self)
self
},
#' * `$hasClass(class)`: Determine whether the selected elements have a
#' given class. Returns a vector of logical values.
Expand All @@ -743,7 +743,7 @@ tagQuery_ <- function(
toggleClass = function(class) {
rebuild_()
tagQueryClassToggle(selected_, class)
invisible(self)
self
},

#' * `$addAttrs(...)`: Add named attributes to all selected children.
Expand All @@ -752,21 +752,21 @@ tagQuery_ <- function(
rebuild_()
tagQueryAttrsAdd(selected_, ...)
# no need to rebuild_(); already flattened in add attr function
invisible(self)
self
},
#' * `$removeAttrs(attrs)`: Removes the provided attributes in each of
#' the selected elements.
removeAttrs = function(attrs) {
rebuild_()
tagQueryAttrsRemove(selected_, attrs)
invisible(self)
self
},
#' * `$emptyAttrs()`: Removes all attributes in each of the selected
#' elements.
emptyAttrs = function() {
rebuild_()
tagQueryAttrsEmpty(selected_)
invisible(self)
self
},
#' * `$hasAttr(attr)`: Returns a vector whose values are whether the
#' selected element contains the non-`NULL` attribute.
Expand All @@ -784,7 +784,7 @@ tagQuery_ <- function(
rebuild_()
tagQueryChildrenAppend(selected_, ...)
rebuild_()
invisible(self)
self
},
#' * `$prepend(...)`: Add all `...` objects as children **before** any
#' existing children to the selected elements. A variation of
Expand All @@ -793,7 +793,7 @@ tagQuery_ <- function(
rebuild_()
tagQueryChildrenPrepend(selected_, ...)
rebuild_()
invisible(self)
self
},
#' * `$empty()`: Remove all children in the selected elements. Use this
#' method before calling `$append(...)` to replace all selected
Expand All @@ -802,7 +802,7 @@ tagQuery_ <- function(
rebuild_()
tagQueryChildrenEmpty(selected_)
# no need to rebuild_
invisible(self)
self
},
## end Adjust Children

Expand All @@ -814,15 +814,15 @@ tagQuery_ <- function(
rebuild_()
tagQuerySiblingAfter(selected_, ...)
rebuild_()
invisible(self)
self
},
#' * `$before(...)`: Add all `...` objects as siblings before each of
#' the selected elements.
before = function(...) {
rebuild_()
tagQuerySiblingBefore(selected_, ...)
rebuild_()
invisible(self)
self
},
#' * `$replaceWith(...)`: Replace all selected elements with `...`. This
#' also sets the selected elements to an empty set. A new `tagQuery()`
Expand Down Expand Up @@ -860,7 +860,7 @@ tagQuery_ <- function(
rebuild_()
tagQueryEach(selected_, fn)
rebuild_()
invisible(self)
self
},
## end Generic Methods

Expand Down Expand Up @@ -889,7 +889,7 @@ tagQuery_ <- function(
#' introduced into the tag structure.
rebuild = function() {
rebuild_()
invisible(self)
self
},
#' * `$print()`: Internal print method. Called by
#' `print.htmltools.tag.query()`
Expand Down

0 comments on commit 62b2f7d

Please sign in to comment.