From 62b2f7dcd9fc01d856301d4f3b38d8a7ab56f671 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Thu, 22 Apr 2021 16:30:42 -0400 Subject: [PATCH] Revert "Return invisibly when not creating a new tagQuery() object (#228)" This reverts commit 3a2757fbce87b5404cf22dd32e5bc9d7ef249761. --- R/tag_query.R | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/R/tag_query.R b/R/tag_query.R index da07f9a5..186fd34e 100644 --- a/R/tag_query.R +++ b/R/tag_query.R @@ -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. @@ -743,7 +743,7 @@ tagQuery_ <- function( toggleClass = function(class) { rebuild_() tagQueryClassToggle(selected_, class) - invisible(self) + self }, #' * `$addAttrs(...)`: Add named attributes to all selected children. @@ -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. @@ -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 @@ -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 @@ -802,7 +802,7 @@ tagQuery_ <- function( rebuild_() tagQueryChildrenEmpty(selected_) # no need to rebuild_ - invisible(self) + self }, ## end Adjust Children @@ -814,7 +814,7 @@ tagQuery_ <- function( rebuild_() tagQuerySiblingAfter(selected_, ...) rebuild_() - invisible(self) + self }, #' * `$before(...)`: Add all `...` objects as siblings before each of #' the selected elements. @@ -822,7 +822,7 @@ tagQuery_ <- 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()` @@ -860,7 +860,7 @@ tagQuery_ <- function( rebuild_() tagQueryEach(selected_, fn) rebuild_() - invisible(self) + self }, ## end Generic Methods @@ -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()`