Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

htmlOutput: allow custom container function #704

Merged
merged 2 commits into from Feb 4, 2015
Merged

Conversation

wch
Copy link
Collaborator

@wch wch commented Jan 27, 2015

This PR allows using a custom container for uiOutput, instead of just div or span. It also allows adding custom classes to the container.

This is for rstudio/shinydashboard#1.

htmlOutput <- function(outputId, inline = FALSE) {
container <- if (inline) span else div
container(id = outputId, class="shiny-html-output")
htmlOutput <- function(outputId, inline = FALSE,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we really wanted to have the arguments be id, container, inline (both for consistency and because we think container is more likely?) then we could just do that and treat container=TRUE as container=span and container=FALSE as container=div.

I'm also 100% fine with taking this PR as-is. This suggestion is just in case it bothers you that the order is different.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be a warning if you pass unnamed arguments to ...? (meaning contents that will be wiped out when a value is rendered)

I could see people using that to display loading messages. I'm not sure if that's how we want to solve that problem though.

@wch
Copy link
Collaborator Author

wch commented Feb 3, 2015

Good idea with checking for unnamed args in .... I've added it.

wch added a commit that referenced this pull request Feb 4, 2015
htmlOutput: allow custom container function
@wch wch merged commit a4d567e into rstudio:master Feb 4, 2015
@wch wch deleted the html-replace2 branch February 4, 2015 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants