From dcab5b1adaf56ec47897ecfe2b4baf7dc69981db Mon Sep 17 00:00:00 2001 From: Divad0175 Date: Tue, 12 Feb 2019 09:24:57 +0100 Subject: [PATCH] add "hidden-xs" class to logo so that it is not displayed when title is NULL --- DESCRIPTION | 2 +- R/dashboardHeader.R | 3 ++- man/dashboardHeader.Rd | 4 ++-- man/dashboardPage.Rd | 4 ++-- man/dashboardSidebar.Rd | 3 ++- man/dropdownMenu.Rd | 3 ++- man/notificationItem.Rd | 4 ++-- man/sidebarMenu.Rd | 8 ++++---- 8 files changed, 17 insertions(+), 14 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4e4c25eb..b343a33c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,4 +20,4 @@ Imports: htmltools (>= 0.2.6), promises BugReports: https://github.com/rstudio/shinydashboard -RoxygenNote: 6.0.1.9000 +RoxygenNote: 6.1.1 diff --git a/R/dashboardHeader.R b/R/dashboardHeader.R index 80dbbbba..0dd219ab 100644 --- a/R/dashboardHeader.R +++ b/R/dashboardHeader.R @@ -115,7 +115,8 @@ dashboardHeader <- function(..., title = NULL, titleWidth = NULL, disable = FALS tags$header(class = "main-header", custom_css, style = if (disable) "display: none;", - span(class = "logo", title), + # hide logo on small screen devices only if title is NULL + span(class = if (is.null(title)) "logo hidden-xs" else "logo", title), tags$nav(class = "navbar navbar-static-top", role = "navigation", # Embed hidden icon so that we get the font-awesome dependency span(shiny::icon("bars"), style = "display:none;"), diff --git a/man/dashboardHeader.Rd b/man/dashboardHeader.Rd index c31a01cb..a38364b6 100644 --- a/man/dashboardHeader.Rd +++ b/man/dashboardHeader.Rd @@ -4,8 +4,8 @@ \alias{dashboardHeader} \title{Create a header for a dashboard page} \usage{ -dashboardHeader(..., title = NULL, titleWidth = NULL, disable = FALSE, - .list = NULL) +dashboardHeader(..., title = NULL, titleWidth = NULL, + disable = FALSE, .list = NULL) } \arguments{ \item{...}{Items to put in the header. Should be \code{\link{dropdownMenu}}s.} diff --git a/man/dashboardPage.Rd b/man/dashboardPage.Rd index 2e29f3e0..b3420778 100644 --- a/man/dashboardPage.Rd +++ b/man/dashboardPage.Rd @@ -4,8 +4,8 @@ \alias{dashboardPage} \title{Dashboard page} \usage{ -dashboardPage(header, sidebar, body, title = NULL, skin = c("blue", "black", - "purple", "green", "red", "yellow")) +dashboardPage(header, sidebar, body, title = NULL, skin = c("blue", + "black", "purple", "green", "red", "yellow")) } \arguments{ \item{header}{A header created by \code{dashboardHeader}.} diff --git a/man/dashboardSidebar.Rd b/man/dashboardSidebar.Rd index 20aa54ed..db4fefa0 100644 --- a/man/dashboardSidebar.Rd +++ b/man/dashboardSidebar.Rd @@ -4,7 +4,8 @@ \alias{dashboardSidebar} \title{Create a dashboard sidebar.} \usage{ -dashboardSidebar(..., disable = FALSE, width = NULL, collapsed = FALSE) +dashboardSidebar(..., disable = FALSE, width = NULL, + collapsed = FALSE) } \arguments{ \item{...}{Items to put in the sidebar.} diff --git a/man/dropdownMenu.Rd b/man/dropdownMenu.Rd index 2307cd01..2f2c3df4 100644 --- a/man/dropdownMenu.Rd +++ b/man/dropdownMenu.Rd @@ -5,7 +5,8 @@ \title{Create a dropdown menu to place in a dashboard header} \usage{ dropdownMenu(..., type = c("messages", "notifications", "tasks"), - badgeStatus = "primary", icon = NULL, headerText = NULL, .list = NULL) + badgeStatus = "primary", icon = NULL, headerText = NULL, + .list = NULL) } \arguments{ \item{...}{Items to put in the menu. Typically, message menus should contain diff --git a/man/notificationItem.Rd b/man/notificationItem.Rd index 41a6feda..a71dced6 100644 --- a/man/notificationItem.Rd +++ b/man/notificationItem.Rd @@ -4,8 +4,8 @@ \alias{notificationItem} \title{Create a notification item to place in a dropdown notification menu} \usage{ -notificationItem(text, icon = shiny::icon("warning"), status = "success", - href = NULL) +notificationItem(text, icon = shiny::icon("warning"), + status = "success", href = NULL) } \arguments{ \item{text}{The notification text.} diff --git a/man/sidebarMenu.Rd b/man/sidebarMenu.Rd index 4fac78b0..e3d5fbea 100644 --- a/man/sidebarMenu.Rd +++ b/man/sidebarMenu.Rd @@ -8,10 +8,10 @@ \usage{ sidebarMenu(..., id = NULL, .list = NULL) -menuItem(text, ..., icon = NULL, badgeLabel = NULL, badgeColor = "green", - tabName = NULL, href = NULL, newtab = TRUE, selected = NULL, - expandedName = as.character(gsub("[[:space:]]", "", text)), - startExpanded = FALSE) +menuItem(text, ..., icon = NULL, badgeLabel = NULL, + badgeColor = "green", tabName = NULL, href = NULL, newtab = TRUE, + selected = NULL, expandedName = as.character(gsub("[[:space:]]", "", + text)), startExpanded = FALSE) menuSubItem(text, tabName = NULL, href = NULL, newtab = TRUE, icon = shiny::icon("angle-double-right"), selected = NULL)