diff --git a/R/dashboardSidebar.R b/R/dashboardSidebar.R index 0e972f97..3595873b 100644 --- a/R/dashboardSidebar.R +++ b/R/dashboardSidebar.R @@ -243,6 +243,13 @@ sidebarSearchForm <- function(textId, buttonId, label = "Search...", #' @param selected If \code{TRUE}, this \code{menuItem} or \code{menuSubItem} #' will start selected. If no item have \code{selected=TRUE}, then the first #' \code{menuItem} will start selected. +#' @param expandedName A unique name given to each \code{menuItem} that serves +#' to indicate which one (if any) is currently expanded. (This is only applicable +#' to \code{menuItem}s that have children and it is mostly only useful for +#' bookmarking state.) +#' @param startExpanded Should this \code{menuItem} be expanded on app startup? +#' (This is only applicable to \code{menuItem}s that have children, and only +#' one of these can be expanded at any given time). #' @param ... For menu items, this may consist of \code{\link{menuSubItem}}s. #' @param .list An optional list containing items to put in the menu Same as the #' \code{...} arguments, but in list format. This can be useful when working @@ -270,7 +277,9 @@ sidebarMenu <- function(..., id = NULL, .list = NULL) { # Given a menuItem and a logical value for `selected`, set the # data-start-selected attribute to the appropriate value (1 or 0). selectItem <- function(item, selected) { - if (length(item$children) == 0) { + + # in the cases that the children of menuItems are NOT menuSubItems + if (is.atomic(item) || length(item$children) == 0) { return(item) } @@ -281,6 +290,7 @@ sidebarMenu <- function(..., id = NULL, .list = NULL) { # data-start-selected="1". The []<- assignment is to preserve # attributes. item$children[] <- lapply(item$children, function(child) { + # Find the appropriate child if (tagMatches(child, name = "a", `data-toggle` = "tab")) { child$attribs[["data-start-selected"]] <- value @@ -335,18 +345,25 @@ sidebarMenu <- function(..., id = NULL, .list = NULL) { item }) } + # This is a 0 height div, whose only purpose is to hold the tabName of the currently + # selected menuItem in its `data-value` attribute. This is the DOM element that is + # bound to tabItemInputBinding in the JS side. + items[[length(items) + 1]] <- div(id = id, + class = "sidebarMenuSelectedTabItem", `data-value` = selectedTabName %OR% "null") } # Use do.call so that we don't add an extra list layer to the children of the # ul tag. This makes it a little easier to traverse the tree to search for # selected items to restore. - do.call(tags$ul, c(id = id, class = "sidebar-menu", items)) + do.call(tags$ul, c(class = "sidebar-menu", items)) } #' @rdname sidebarMenu #' @export menuItem <- function(text, ..., icon = NULL, badgeLabel = NULL, badgeColor = "green", - tabName = NULL, href = NULL, newtab = TRUE, selected = NULL) { + tabName = NULL, href = NULL, newtab = TRUE, selected = NULL, + expandedName = as.character(gsub("[[:space:]]", "", text)), + startExpanded = FALSE) { subItems <- list(...) if (!is.null(icon)) tagAssert(icon, type = "i") @@ -401,6 +418,18 @@ menuItem <- function(text, ..., icon = NULL, badgeLabel = NULL, badgeColor = "gr ) } + # If we're restoring a bookmarked app, this holds the value of what menuItem (if any) + # was expanded (this has be to stored separately from the selected menuItem, since + # these actually independent in AdminLTE). If no menuItem was expanded, `dataExpanded` + # is NULL. However, we want to this input to get passed on (and not dropped), so we + # do `%OR% ""` to assure this. + default <- if (startExpanded) expandedName else "" + dataExpanded <- shiny::restoreInput(id = "sidebarItemExpanded", default) %OR% "" + + # If `dataExpanded` is not the empty string, we need to check that it is eqaul to the + # this menuItem's `expandedName`` + isExpanded <- nzchar(dataExpanded) && (dataExpanded == expandedName) + tags$li(class = "treeview", a(href = href, icon, @@ -410,7 +439,11 @@ menuItem <- function(text, ..., icon = NULL, badgeLabel = NULL, badgeColor = "gr # Use do.call so that we don't add an extra list layer to the children of the # ul tag. This makes it a little easier to traverse the tree to search for # selected items to restore. - do.call(tags$ul, c(class = "treeview-menu", subItems)) + do.call(tags$ul, c( + class = paste0("treeview-menu", if (isExpanded) " menu-open" else ""), + style = paste0("display: ", if (isExpanded) "block;" else "none;"), + `data-expanded` = expandedName, + subItems)) ) } diff --git a/inst/shinydashboard.js b/inst/shinydashboard.js index 99dd7ec7..8bd4eec9 100644 --- a/inst/shinydashboard.js +++ b/inst/shinydashboard.js @@ -14,28 +14,31 @@ $(function() { // because they're not designed to be used together for tab panels. This // code ensures that only one item will have the "active" class. var deactivateOtherTabs = function() { - var $this = $(this); - var $sidebarMenu = $this.closest("ul.sidebar-menu"); - - // Find all tab links under sidebar-menu - var $tablinks = $sidebarMenu.find("a[data-toggle='tab']"); + // Find all tab links under sidebar-menu even if they don't have a + // tabName (which is why the second selector is necessary) + var $tablinks = $(".sidebar-menu a[data-toggle='tab']," + + ".sidebar-menu li.treeview > a"); // If any other items are active, deactivate them - $tablinks.not($this).parent("li").removeClass("active"); + $tablinks.not($(this)).parent("li").removeClass("active"); // Trigger event for the tabItemInputBinding - $sidebarMenu.trigger('change.tabItemInputBinding'); + var $obj = $('.sidebarMenuSelectedTabItem'); + var inputBinding = $obj.data('shiny-input-binding'); + if (typeof inputBinding !== 'undefined') { + inputBinding.setValue($obj, $(this).attr('data-value')); + $obj.trigger('change'); + } }; $(document).on('shown.bs.tab', '.sidebar-menu a[data-toggle="tab"]', deactivateOtherTabs); - // When document is ready, if there is a sidebar menu with no activated tabs, // activate the one specified by `data-start-selected`, or if that's not // present, the first one. var ensureActivatedTab = function() { - var $tablinks = $("ul.sidebar-menu").find("a").filter("[data-toggle='tab']"); + var $tablinks = $(".sidebar-menu a[data-toggle='tab']"); // If there's a `data-start-selected` attribute and we can find a tab with // that name, activate it. @@ -48,6 +51,8 @@ var ensureActivatedTab = function() { // If we got this far, just activate the first tab. if (! $tablinks.parent("li").hasClass("active") ) { $tablinks.first().tab("show"); + $(".sidebarMenuSelectedTabItem").attr("data-value", + $tablinks.first().attr("data-value")); } }; @@ -75,8 +80,21 @@ $(document).on("click", ".sidebar-toggle", function() { $obj.trigger('change'); }); +// Whenever we expand a menuItem (to be expandable, it must have children), +// update the value for the expandedItem's input binding (this is the +// tabName of the fist subMenuItem inside the menuItem that is currently +// expanded) $(document).on("click", ".treeview > a", function() { - $(this).next(".treeview-menu").trigger("shown"); + var $menu = $(this).next(); + // If this menuItem was already open, then clicking on it again, + // should trigger the "hidden" event, so Shiny doesn't worry about + // it while it's hidden (and vice versa). + if ($menu.hasClass("menu-open")) $menu.trigger("hidden"); + else if ($menu.hasClass("treeview-menu")) $menu.trigger("shown"); + + // need to set timeout to account for the slideUp/slideDown animation + var $obj = $('section.sidebar.shiny-bound-input'); + setTimeout(function() { $obj.trigger('change'); }, 600); }); //--------------------------------------------------------------------- @@ -141,21 +159,20 @@ Shiny.outputBindings.register(menuOutputBinding, var tabItemInputBinding = new Shiny.InputBinding(); $.extend(tabItemInputBinding, { find: function(scope) { - return $(scope).find('ul.sidebar-menu'); + return $(scope).find('.sidebarMenuSelectedTabItem'); }, getValue: function(el) { - var anchor = $(el).find('li:not(.treeview).active').children('a'); - if (anchor.length === 1) - return this._getTabName(anchor); - - return null; + var value = $(el).attr('data-value'); + if (value === "null") return null; + return value; }, setValue: function(el, value) { var self = this; - var anchors = $(el).find('li:not(.treeview)').children('a'); + var anchors = $(el).parent('ul.sidebar-menu').find('li:not(.treeview)').children('a'); anchors.each(function() { // eslint-disable-line consistent-return if (self._getTabName($(this)) === value) { $(this).tab('show'); + $(el).attr('data-value', self._getTabName($(this))); return false; } }); @@ -179,6 +196,7 @@ $.extend(tabItemInputBinding, { return anchor.attr('data-value'); } }); + Shiny.inputBindings.register(tabItemInputBinding, 'shinydashboard.tabItemInput'); //--------------------------------------------------------------------- @@ -225,6 +243,39 @@ $.extend(sidebarCollapsedInputBinding, { Shiny.inputBindings.register(sidebarCollapsedInputBinding, 'shinydashboard.sidebarCollapsedInputBinding'); +//--------------------------------------------------------------------- +// Source file: ../srcjs/input_binding_sidebarmenuExpanded.js + +/* global Shiny */ + +// sidebarmenuExpandedInputBinding +// ------------------------------------------------------------------ +// This keeps tracks of what menuItem (if any) is expanded +var sidebarmenuExpandedInputBinding = new Shiny.InputBinding(); +$.extend(sidebarmenuExpandedInputBinding, { + find: function(scope) { + return $(scope).find('section.sidebar'); + }, + getId: function(el) { + return "sidebarItemExpanded"; + }, + getValue: function(el) { + var $open = $(el).find('li ul.menu-open'); + if ($open.length === 1) return $open.attr('data-expanded'); + else return null; + }, + subscribe: function(el, callback) { + $(el).on('change.sidebarmenuExpandedInputBinding', function() { + callback(); + }); + }, + unsubscribe: function(el) { + $(el).off('.sidebarmenuExpandedInputBinding'); + } +}); +Shiny.inputBindings.register(sidebarmenuExpandedInputBinding, + 'shinydashboard.sidebarmenuExpandedInputBinding'); + //--------------------------------------------------------------------- // Source file: ../srcjs/_end.js diff --git a/inst/shinydashboard.js.map b/inst/shinydashboard.js.map index 56ddbf10..678ba31e 100644 --- a/inst/shinydashboard.js.map +++ b/inst/shinydashboard.js.map @@ -1 +1 @@ -{"version":3,"sources":["../srcjs/_start.js","../srcjs/tabs.js","../srcjs/sidebar.js","../srcjs/output_binding_menu.js","../srcjs/input_binding_tabItem.js","../srcjs/input_binding_sidebarCollapsed.js","../srcjs/_end.js"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE;AAClC;AACA,EAAE,QAAQ,EAAE,CAAC,CAAC;;ACHd,uEAAuE;AACvE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE;AAChC;AACA,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK;AAC3E,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG;AAC1E,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;AACrE,EAAE,CAA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I,EAAE,EAAE,EAAE,GAAG,GAAG,4BAA4B,GAAG;AAC/C,EAAE,CAAC;AACH,GAAG;AACH,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,4BAA4B,CAAC;AAC1D,EAAE,CAAC,cAAc,CAAC,4BAA4B,GAAG;;AC1CjD,uEAAuE;AACvE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE;AAChC;AACA,GAAG","file":"shinydashboard.js","sourcesContent":["//---------------------------------------------------------------------\n// Source file: ../srcjs/_start.js\n\n$(function() {\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/tabs.js\n\n// This function handles a special case in the AdminLTE sidebar: when there\n// is a sidebar-menu with items, and one of those items has sub-items, and\n// they are used for tab navigation. Normally, if one of the items is\n// selected and then a sub-item is clicked, both the item and sub-item will\n// retain the \"active\" class, so they will both be highlighted. This happens\n// because they're not designed to be used together for tab panels. This\n// code ensures that only one item will have the \"active\" class.\nvar deactivateOtherTabs = function() {\n var $this = $(this);\n var $sidebarMenu = $this.closest(\"ul.sidebar-menu\");\n\n // Find all tab links under sidebar-menu\n var $tablinks = $sidebarMenu.find(\"a[data-toggle='tab']\");\n\n // If any other items are active, deactivate them\n $tablinks.not($this).parent(\"li\").removeClass(\"active\");\n\n // Trigger event for the tabItemInputBinding\n $sidebarMenu.trigger('change.tabItemInputBinding');\n};\n\n$(document).on('shown.bs.tab', '.sidebar-menu a[data-toggle=\"tab\"]',\n deactivateOtherTabs);\n\n\n// When document is ready, if there is a sidebar menu with no activated tabs,\n// activate the one specified by `data-start-selected`, or if that's not\n// present, the first one.\nvar ensureActivatedTab = function() {\n var $tablinks = $(\"ul.sidebar-menu\").find(\"a\").filter(\"[data-toggle='tab']\");\n\n // If there's a `data-start-selected` attribute and we can find a tab with\n // that name, activate it.\n var $startTab = $tablinks.filter(\"[data-start-selected='1']\");\n if ($startTab.length !== 0) {\n $startTab.tab(\"show\");\n return;\n }\n\n // If we got this far, just activate the first tab.\n if (! $tablinks.parent(\"li\").hasClass(\"active\") ) {\n $tablinks.first().tab(\"show\");\n }\n};\n\nensureActivatedTab();\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/sidebar.js\n\n// Optionally disable sidebar (set through the `disable` argument\n// to the `dashboardSidebar` function)\nif ($(\"section.sidebar\").data(\"disable\")) {\n $(\"body\").addClass(\"sidebar-collapse\");\n $(\".navbar > .sidebar-toggle\").hide();\n}\n\n// Whenever the sidebar expand/collapse button is clicked:\n$(document).on(\"click\", \".sidebar-toggle\", function() {\n // 1) Trigger the resize event (so images are responsive and resize)\n $(window).trigger(\"resize\");\n\n // 2) Update the value for the sidebar's input binding\n var $obj = $('.main-sidebar.shiny-bound-input');\n var inputBinding = $obj.data('shiny-input-binding');\n inputBinding.toggleValue($obj);\n $obj.trigger('change');\n});\n\n$(document).on(\"click\", \".treeview > a\", function() {\n $(this).next(\".treeview-menu\").trigger(\"shown\");\n});\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/output_binding_menu.js\n\n/* global Shiny */\n\n// menuOutputBinding\n// ------------------------------------------------------------------\n// Based on Shiny.htmlOutputBinding, but instead of putting the result in a\n// wrapper div, it replaces the origin DOM element with the new DOM elements,\n// copying over the ID and class.\nvar menuOutputBinding = new Shiny.OutputBinding();\n$.extend(menuOutputBinding, {\n find: function(scope) {\n return $(scope).find('.shinydashboard-menu-output');\n },\n onValueError: function(el, err) {\n Shiny.unbindAll(el);\n this.renderError(el, err);\n },\n renderValue: function(el, data) {\n Shiny.unbindAll(el);\n\n var html;\n var dependencies = [];\n if (data === null) {\n return;\n } else if (typeof(data) === 'string') {\n html = data;\n } else if (typeof(data) === 'object') {\n html = data.html;\n dependencies = data.deps;\n }\n\n var $html = $($.parseHTML(html));\n\n // Convert the inner contents to HTML, and pass to renderHtml\n Shiny.renderHtml($html.html(), el, dependencies);\n\n // Extract class of wrapper, and add them to the wrapper element\n el.className = 'shinydashboard-menu-output shiny-bound-output ' +\n $html.attr('class');\n\n Shiny.initializeInputs(el);\n Shiny.bindAll(el);\n ensureActivatedTab(); // eslint-disable-line\n }\n});\nShiny.outputBindings.register(menuOutputBinding,\n \"shinydashboard.menuOutputBinding\");\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/input_binding_tabItem.js\n\n/* global Shiny */\n\n// tabItemInputBinding\n// ------------------------------------------------------------------\n// Based on Shiny.tabItemInputBinding, but customized for tabItems in\n// shinydashboard, which have a slightly different structure.\nvar tabItemInputBinding = new Shiny.InputBinding();\n$.extend(tabItemInputBinding, {\n find: function(scope) {\n return $(scope).find('ul.sidebar-menu');\n },\n getValue: function(el) {\n var anchor = $(el).find('li:not(.treeview).active').children('a');\n if (anchor.length === 1)\n return this._getTabName(anchor);\n\n return null;\n },\n setValue: function(el, value) {\n var self = this;\n var anchors = $(el).find('li:not(.treeview)').children('a');\n anchors.each(function() { // eslint-disable-line consistent-return\n if (self._getTabName($(this)) === value) {\n $(this).tab('show');\n return false;\n }\n });\n },\n receiveMessage: function(el, data) {\n if (data.hasOwnProperty('value'))\n this.setValue(el, data.value);\n },\n subscribe: function(el, callback) {\n // This event is triggered by deactivateOtherTabs, which is triggered by\n // shown. The deactivation of other tabs must occur before Shiny gets the\n // input value.\n $(el).on('change.tabItemInputBinding', function() {\n callback();\n });\n },\n unsubscribe: function(el) {\n $(el).off('.tabItemInputBinding');\n },\n _getTabName: function(anchor) {\n return anchor.attr('data-value');\n }\n});\nShiny.inputBindings.register(tabItemInputBinding, 'shinydashboard.tabItemInput');\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/input_binding_sidebarCollapsed.js\n\n/* global Shiny */\n\n// sidebarCollapsedInputBinding\n// ------------------------------------------------------------------\n// This keeps tracks of whether the sidebar is expanded (default)\n// or collapsed\nvar sidebarCollapsedInputBinding = new Shiny.InputBinding();\n$.extend(sidebarCollapsedInputBinding, {\n find: function(scope) {\n return $(scope).find('.main-sidebar').first();\n },\n getId: function(el) {\n return \"sidebarCollapsed\";\n },\n getValue: function(el) {\n return $(el).attr(\"data-collapsed\");\n },\n setValue: function(el, value) {\n $(el).attr(\"data-collapsed\", value);\n },\n toggleValue: function(el) {\n var current = this.getValue(el);\n var newVal = (current === \"true\") ? \"false\" : \"true\";\n this.setValue(el, newVal);\n },\n receiveMessage: function(el, data) {\n if (data.hasOwnProperty('value'))\n this.setValue(el, data.value);\n },\n subscribe: function(el, callback) {\n $(el).on('change.sidebarCollapsedInputBinding', function() {\n callback();\n });\n },\n unsubscribe: function(el) {\n $(el).off('.sidebarCollapsedInputBinding');\n }\n});\nShiny.inputBindings.register(sidebarCollapsedInputBinding,\n 'shinydashboard.sidebarCollapsedInputBinding');\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/_end.js\n\n});\n"]} \ No newline at end of file +{"version":3,"sources":["../srcjs/_start.js","../srcjs/tabs.js","../srcjs/sidebar.js","../srcjs/output_binding_menu.js","../srcjs/input_binding_tabItem.js","../srcjs/input_binding_sidebarCollapsed.js","../srcjs/input_binding_sidebarmenuExpanded.js","../srcjs/_end.js"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE;AAClC;AACA,EAAE,QAAQ,EAAE,CAAC,CAAC;;ACHd,uEAAuE;AACvE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE;AAChC;AACA,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK;AAC3E,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,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E,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,GAAG;AAC9C,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAG;AAC/D,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;AACrB,EAAE,EAAE;AACJ,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AACrC,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,+BAA+B,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;AACnE,MAAM,QAAQ,GAAG;AACjB,IAAI,GAAG;AACP,EAAE,EAAE;AACJ,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;AAC7B,IAAI,EAAE,EAAE,EAAE,GAAG,GAAG,+BAA+B,GAAG;AAClD,EAAE,CAAC;AACH,GAAG;AACH,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,+BAA+B,CAAC;AAC7D,EAAE,CAAC,cAAc,CAAC,+BAA+B,GAAG;;AC/BpD,uEAAuE;AACvE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE;AAChC;AACA,GAAG","file":"shinydashboard.js","sourcesContent":["//---------------------------------------------------------------------\n// Source file: ../srcjs/_start.js\n\n$(function() {\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/tabs.js\n\n// This function handles a special case in the AdminLTE sidebar: when there\n// is a sidebar-menu with items, and one of those items has sub-items, and\n// they are used for tab navigation. Normally, if one of the items is\n// selected and then a sub-item is clicked, both the item and sub-item will\n// retain the \"active\" class, so they will both be highlighted. This happens\n// because they're not designed to be used together for tab panels. This\n// code ensures that only one item will have the \"active\" class.\nvar deactivateOtherTabs = function() {\n // Find all tab links under sidebar-menu even if they don't have a\n // tabName (which is why the second selector is necessary)\n var $tablinks = $(\".sidebar-menu a[data-toggle='tab'],\" +\n \".sidebar-menu li.treeview > a\");\n\n // If any other items are active, deactivate them\n $tablinks.not($(this)).parent(\"li\").removeClass(\"active\");\n\n // Trigger event for the tabItemInputBinding\n var $obj = $('.sidebarMenuSelectedTabItem');\n var inputBinding = $obj.data('shiny-input-binding');\n if (typeof inputBinding !== 'undefined') {\n inputBinding.setValue($obj, $(this).attr('data-value'));\n $obj.trigger('change');\n }\n};\n\n$(document).on('shown.bs.tab', '.sidebar-menu a[data-toggle=\"tab\"]',\n deactivateOtherTabs);\n\n// When document is ready, if there is a sidebar menu with no activated tabs,\n// activate the one specified by `data-start-selected`, or if that's not\n// present, the first one.\nvar ensureActivatedTab = function() {\n var $tablinks = $(\".sidebar-menu a[data-toggle='tab']\");\n\n // If there's a `data-start-selected` attribute and we can find a tab with\n // that name, activate it.\n var $startTab = $tablinks.filter(\"[data-start-selected='1']\");\n if ($startTab.length !== 0) {\n $startTab.tab(\"show\");\n return;\n }\n\n // If we got this far, just activate the first tab.\n if (! $tablinks.parent(\"li\").hasClass(\"active\") ) {\n $tablinks.first().tab(\"show\");\n $(\".sidebarMenuSelectedTabItem\").attr(\"data-value\",\n $tablinks.first().attr(\"data-value\"));\n }\n};\n\nensureActivatedTab();\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/sidebar.js\n\n// Optionally disable sidebar (set through the `disable` argument\n// to the `dashboardSidebar` function)\nif ($(\"section.sidebar\").data(\"disable\")) {\n $(\"body\").addClass(\"sidebar-collapse\");\n $(\".navbar > .sidebar-toggle\").hide();\n}\n\n// Whenever the sidebar expand/collapse button is clicked:\n$(document).on(\"click\", \".sidebar-toggle\", function() {\n // 1) Trigger the resize event (so images are responsive and resize)\n $(window).trigger(\"resize\");\n\n // 2) Update the value for the sidebar's input binding\n var $obj = $('.main-sidebar.shiny-bound-input');\n var inputBinding = $obj.data('shiny-input-binding');\n inputBinding.toggleValue($obj);\n $obj.trigger('change');\n});\n\n// Whenever we expand a menuItem (to be expandable, it must have children),\n// update the value for the expandedItem's input binding (this is the\n// tabName of the fist subMenuItem inside the menuItem that is currently\n// expanded)\n$(document).on(\"click\", \".treeview > a\", function() {\n var $menu = $(this).next();\n // If this menuItem was already open, then clicking on it again,\n // should trigger the \"hidden\" event, so Shiny doesn't worry about\n // it while it's hidden (and vice versa).\n if ($menu.hasClass(\"menu-open\")) $menu.trigger(\"hidden\");\n else if ($menu.hasClass(\"treeview-menu\")) $menu.trigger(\"shown\");\n\n // need to set timeout to account for the slideUp/slideDown animation\n var $obj = $('section.sidebar.shiny-bound-input');\n setTimeout(function() { $obj.trigger('change'); }, 600);\n});\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/output_binding_menu.js\n\n/* global Shiny */\n\n// menuOutputBinding\n// ------------------------------------------------------------------\n// Based on Shiny.htmlOutputBinding, but instead of putting the result in a\n// wrapper div, it replaces the origin DOM element with the new DOM elements,\n// copying over the ID and class.\nvar menuOutputBinding = new Shiny.OutputBinding();\n$.extend(menuOutputBinding, {\n find: function(scope) {\n return $(scope).find('.shinydashboard-menu-output');\n },\n onValueError: function(el, err) {\n Shiny.unbindAll(el);\n this.renderError(el, err);\n },\n renderValue: function(el, data) {\n Shiny.unbindAll(el);\n\n var html;\n var dependencies = [];\n if (data === null) {\n return;\n } else if (typeof(data) === 'string') {\n html = data;\n } else if (typeof(data) === 'object') {\n html = data.html;\n dependencies = data.deps;\n }\n\n var $html = $($.parseHTML(html));\n\n // Convert the inner contents to HTML, and pass to renderHtml\n Shiny.renderHtml($html.html(), el, dependencies);\n\n // Extract class of wrapper, and add them to the wrapper element\n el.className = 'shinydashboard-menu-output shiny-bound-output ' +\n $html.attr('class');\n\n Shiny.initializeInputs(el);\n Shiny.bindAll(el);\n ensureActivatedTab(); // eslint-disable-line\n }\n});\nShiny.outputBindings.register(menuOutputBinding,\n \"shinydashboard.menuOutputBinding\");\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/input_binding_tabItem.js\n\n/* global Shiny */\n\n// tabItemInputBinding\n// ------------------------------------------------------------------\n// Based on Shiny.tabItemInputBinding, but customized for tabItems in\n// shinydashboard, which have a slightly different structure.\nvar tabItemInputBinding = new Shiny.InputBinding();\n$.extend(tabItemInputBinding, {\n find: function(scope) {\n return $(scope).find('.sidebarMenuSelectedTabItem');\n },\n getValue: function(el) {\n var value = $(el).attr('data-value');\n if (value === \"null\") return null;\n return value;\n },\n setValue: function(el, value) {\n var self = this;\n var anchors = $(el).parent('ul.sidebar-menu').find('li:not(.treeview)').children('a');\n anchors.each(function() { // eslint-disable-line consistent-return\n if (self._getTabName($(this)) === value) {\n $(this).tab('show');\n $(el).attr('data-value', self._getTabName($(this)));\n return false;\n }\n });\n },\n receiveMessage: function(el, data) {\n if (data.hasOwnProperty('value'))\n this.setValue(el, data.value);\n },\n subscribe: function(el, callback) {\n // This event is triggered by deactivateOtherTabs, which is triggered by\n // shown. The deactivation of other tabs must occur before Shiny gets the\n // input value.\n $(el).on('change.tabItemInputBinding', function() {\n callback();\n });\n },\n unsubscribe: function(el) {\n $(el).off('.tabItemInputBinding');\n },\n _getTabName: function(anchor) {\n return anchor.attr('data-value');\n }\n});\n\nShiny.inputBindings.register(tabItemInputBinding, 'shinydashboard.tabItemInput');\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/input_binding_sidebarCollapsed.js\n\n/* global Shiny */\n\n// sidebarCollapsedInputBinding\n// ------------------------------------------------------------------\n// This keeps tracks of whether the sidebar is expanded (default)\n// or collapsed\nvar sidebarCollapsedInputBinding = new Shiny.InputBinding();\n$.extend(sidebarCollapsedInputBinding, {\n find: function(scope) {\n return $(scope).find('.main-sidebar').first();\n },\n getId: function(el) {\n return \"sidebarCollapsed\";\n },\n getValue: function(el) {\n return $(el).attr(\"data-collapsed\");\n },\n setValue: function(el, value) {\n $(el).attr(\"data-collapsed\", value);\n },\n toggleValue: function(el) {\n var current = this.getValue(el);\n var newVal = (current === \"true\") ? \"false\" : \"true\";\n this.setValue(el, newVal);\n },\n receiveMessage: function(el, data) {\n if (data.hasOwnProperty('value'))\n this.setValue(el, data.value);\n },\n subscribe: function(el, callback) {\n $(el).on('change.sidebarCollapsedInputBinding', function() {\n callback();\n });\n },\n unsubscribe: function(el) {\n $(el).off('.sidebarCollapsedInputBinding');\n }\n});\nShiny.inputBindings.register(sidebarCollapsedInputBinding,\n 'shinydashboard.sidebarCollapsedInputBinding');\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/input_binding_sidebarmenuExpanded.js\n\n/* global Shiny */\n\n// sidebarmenuExpandedInputBinding\n// ------------------------------------------------------------------\n// This keeps tracks of what menuItem (if any) is expanded\nvar sidebarmenuExpandedInputBinding = new Shiny.InputBinding();\n$.extend(sidebarmenuExpandedInputBinding, {\n find: function(scope) {\n return $(scope).find('section.sidebar');\n },\n getId: function(el) {\n return \"sidebarItemExpanded\";\n },\n getValue: function(el) {\n var $open = $(el).find('li ul.menu-open');\n if ($open.length === 1) return $open.attr('data-expanded');\n else return null;\n },\n subscribe: function(el, callback) {\n $(el).on('change.sidebarmenuExpandedInputBinding', function() {\n callback();\n });\n },\n unsubscribe: function(el) {\n $(el).off('.sidebarmenuExpandedInputBinding');\n }\n});\nShiny.inputBindings.register(sidebarmenuExpandedInputBinding,\n 'shinydashboard.sidebarmenuExpandedInputBinding');\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/_end.js\n\n});\n"]} \ No newline at end of file diff --git a/inst/shinydashboard.min.js b/inst/shinydashboard.min.js index af839729..7f7bcd08 100644 --- a/inst/shinydashboard.min.js +++ b/inst/shinydashboard.min.js @@ -1,4 +1,4 @@ /*! shinydashboard 0.5.3.9000 | (c) 2017-2017 RStudio, Inc. | License: GPL-2 | file LICENSE */ -$(function(){var a=function(){var a=$(this),b=a.closest("ul.sidebar-menu"),c=b.find("a[data-toggle='tab']");c.not(a).parent("li").removeClass("active"),b.trigger("change.tabItemInputBinding")};$(document).on("shown.bs.tab",'.sidebar-menu a[data-toggle="tab"]',a);var b=function(){var a=$("ul.sidebar-menu").find("a").filter("[data-toggle='tab']"),b=a.filter("[data-start-selected='1']");return 0!==b.length?void b.tab("show"):void(a.parent("li").hasClass("active")||a.first().tab("show"))};b(),$("section.sidebar").data("disable")&&($("body").addClass("sidebar-collapse"),$(".navbar > .sidebar-toggle").hide()),$(document).on("click",".sidebar-toggle",function(){$(window).trigger("resize");var a=$(".main-sidebar.shiny-bound-input"),b=a.data("shiny-input-binding");b.toggleValue(a),a.trigger("change")}),$(document).on("click",".treeview > a",function(){$(this).next(".treeview-menu").trigger("shown")});var c=new Shiny.OutputBinding;$.extend(c,{find:function(a){return $(a).find(".shinydashboard-menu-output")},onValueError:function(a,b){Shiny.unbindAll(a),this.renderError(a,b)},renderValue:function(a,c){Shiny.unbindAll(a);var d,e=[];if(null!==c){"string"==typeof c?d=c:"object"==typeof c&&(d=c.html,e=c.deps);var f=$($.parseHTML(d));Shiny.renderHtml(f.html(),a,e),a.className="shinydashboard-menu-output shiny-bound-output "+f.attr("class"),Shiny.initializeInputs(a),Shiny.bindAll(a),b()}}}),Shiny.outputBindings.register(c,"shinydashboard.menuOutputBinding");var d=new Shiny.InputBinding;$.extend(d,{find:function(a){return $(a).find("ul.sidebar-menu")},getValue:function(a){var b=$(a).find("li:not(.treeview).active").children("a");return 1===b.length?this._getTabName(b):null},setValue:function(a,b){var c=this,d=$(a).find("li:not(.treeview)").children("a");d.each(function(){if(c._getTabName($(this))===b)return $(this).tab("show"),!1})},receiveMessage:function(a,b){b.hasOwnProperty("value")&&this.setValue(a,b.value)},subscribe:function(a,b){$(a).on("change.tabItemInputBinding",function(){b()})},unsubscribe:function(a){$(a).off(".tabItemInputBinding")},_getTabName:function(a){return a.attr("data-value")}}),Shiny.inputBindings.register(d,"shinydashboard.tabItemInput");var e=new Shiny.InputBinding;$.extend(e,{find:function(a){return $(a).find(".main-sidebar").first()},getId:function(a){return"sidebarCollapsed"},getValue:function(a){return $(a).attr("data-collapsed")},setValue:function(a,b){$(a).attr("data-collapsed",b)},toggleValue:function(a){var b=this.getValue(a),c="true"===b?"false":"true";this.setValue(a,c)},receiveMessage:function(a,b){b.hasOwnProperty("value")&&this.setValue(a,b.value)},subscribe:function(a,b){$(a).on("change.sidebarCollapsedInputBinding",function(){b()})},unsubscribe:function(a){$(a).off(".sidebarCollapsedInputBinding")}}),Shiny.inputBindings.register(e,"shinydashboard.sidebarCollapsedInputBinding")}); +$(function(){var a=function(){var a=$(".sidebar-menu a[data-toggle='tab'],.sidebar-menu li.treeview > a");a.not($(this)).parent("li").removeClass("active");var b=$(".sidebarMenuSelectedTabItem"),c=b.data("shiny-input-binding");"undefined"!=typeof c&&(c.setValue(b,$(this).attr("data-value")),b.trigger("change"))};$(document).on("shown.bs.tab",'.sidebar-menu a[data-toggle="tab"]',a);var b=function(){var a=$(".sidebar-menu a[data-toggle='tab']"),b=a.filter("[data-start-selected='1']");return 0!==b.length?void b.tab("show"):void(a.parent("li").hasClass("active")||(a.first().tab("show"),$(".sidebarMenuSelectedTabItem").attr("data-value",a.first().attr("data-value"))))};b(),$("section.sidebar").data("disable")&&($("body").addClass("sidebar-collapse"),$(".navbar > .sidebar-toggle").hide()),$(document).on("click",".sidebar-toggle",function(){$(window).trigger("resize");var a=$(".main-sidebar.shiny-bound-input"),b=a.data("shiny-input-binding");b.toggleValue(a),a.trigger("change")}),$(document).on("click",".treeview > a",function(){var a=$(this).next();a.hasClass("menu-open")?a.trigger("hidden"):a.hasClass("treeview-menu")&&a.trigger("shown");var b=$("section.sidebar.shiny-bound-input");setTimeout(function(){b.trigger("change")},600)});var c=new Shiny.OutputBinding;$.extend(c,{find:function(a){return $(a).find(".shinydashboard-menu-output")},onValueError:function(a,b){Shiny.unbindAll(a),this.renderError(a,b)},renderValue:function(a,c){Shiny.unbindAll(a);var d,e=[];if(null!==c){"string"==typeof c?d=c:"object"==typeof c&&(d=c.html,e=c.deps);var f=$($.parseHTML(d));Shiny.renderHtml(f.html(),a,e),a.className="shinydashboard-menu-output shiny-bound-output "+f.attr("class"),Shiny.initializeInputs(a),Shiny.bindAll(a),b()}}}),Shiny.outputBindings.register(c,"shinydashboard.menuOutputBinding");var d=new Shiny.InputBinding;$.extend(d,{find:function(a){return $(a).find(".sidebarMenuSelectedTabItem")},getValue:function(a){var b=$(a).attr("data-value");return"null"===b?null:b},setValue:function(a,b){var c=this,d=$(a).parent("ul.sidebar-menu").find("li:not(.treeview)").children("a");d.each(function(){if(c._getTabName($(this))===b)return $(this).tab("show"),$(a).attr("data-value",c._getTabName($(this))),!1})},receiveMessage:function(a,b){b.hasOwnProperty("value")&&this.setValue(a,b.value)},subscribe:function(a,b){$(a).on("change.tabItemInputBinding",function(){b()})},unsubscribe:function(a){$(a).off(".tabItemInputBinding")},_getTabName:function(a){return a.attr("data-value")}}),Shiny.inputBindings.register(d,"shinydashboard.tabItemInput");var e=new Shiny.InputBinding;$.extend(e,{find:function(a){return $(a).find(".main-sidebar").first()},getId:function(a){return"sidebarCollapsed"},getValue:function(a){return $(a).attr("data-collapsed")},setValue:function(a,b){$(a).attr("data-collapsed",b)},toggleValue:function(a){var b=this.getValue(a),c="true"===b?"false":"true";this.setValue(a,c)},receiveMessage:function(a,b){b.hasOwnProperty("value")&&this.setValue(a,b.value)},subscribe:function(a,b){$(a).on("change.sidebarCollapsedInputBinding",function(){b()})},unsubscribe:function(a){$(a).off(".sidebarCollapsedInputBinding")}}),Shiny.inputBindings.register(e,"shinydashboard.sidebarCollapsedInputBinding");var f=new Shiny.InputBinding;$.extend(f,{find:function(a){return $(a).find("section.sidebar")},getId:function(a){return"sidebarItemExpanded"},getValue:function(a){var b=$(a).find("li ul.menu-open");return 1===b.length?b.attr("data-expanded"):null},subscribe:function(a,b){$(a).on("change.sidebarmenuExpandedInputBinding",function(){b()})},unsubscribe:function(a){$(a).off(".sidebarmenuExpandedInputBinding")}}),Shiny.inputBindings.register(f,"shinydashboard.sidebarmenuExpandedInputBinding")}); //# sourceMappingURL=shinydashboard.min.js.map \ No newline at end of file diff --git a/inst/shinydashboard.min.js.map b/inst/shinydashboard.min.js.map index 2a43522f..b7f31bd4 100644 --- a/inst/shinydashboard.min.js.map +++ b/inst/shinydashboard.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../srcjs/_start.js","../srcjs/tabs.js","../srcjs/sidebar.js","../srcjs/output_binding_menu.js","../srcjs/input_binding_tabItem.js","../srcjs/input_binding_sidebarCollapsed.js"],"names":["$","deactivateOtherTabs","$this","this","$sidebarMenu","closest","$tablinks","find","not","parent","removeClass","trigger","document","on","ensureActivatedTab","filter","$startTab","length","tab","hasClass","first","data","addClass","hide","window","$obj","inputBinding","toggleValue","next","menuOutputBinding","Shiny","OutputBinding","extend","scope","onValueError","el","err","unbindAll","renderError","renderValue","html","dependencies","deps","$html","parseHTML","renderHtml","className","attr","initializeInputs","bindAll","outputBindings","register","tabItemInputBinding","InputBinding","getValue","anchor","children","_getTabName","setValue","value","self","anchors","each","receiveMessage","hasOwnProperty","subscribe","callback","unsubscribe","off","inputBindings","sidebarCollapsedInputBinding","getId","current","newVal"],"mappings":";;AAGAA,EAAE,WCOF,GAAIC,GAAsB,WACxB,GAAIC,GAAQF,EAAEG,MACVC,EAAeF,EAAMG,QAAO,mBAG5BC,EAAYF,EAAaG,KAAI,uBAGjCD,GAAUE,IAAGN,GAAQO,OAAM,MAAOC,YAAW,UAG7CN,EAAaO,QAAO,8BAGtBX,GAAEY,UAAUC,GAAE,eAAiB,qCAChBZ,EAMf,IAAIa,GAAqB,WACvB,GAAIR,GAAYN,EAAA,mBAAqBO,KAAI,KAAMQ,OAAM,uBAIjDC,EAAYV,EAAUS,OAAM,4BAChC,OAAyB,KAAtBC,EAAWC,WACZD,GAAUE,IAAG,aAKTZ,EAAUG,OAAM,MAAOU,SAAQ,WACnCb,EAAUc,QAAQF,IAAG,SAIzBJ,KC3CGd,EAAA,mBAAsBqB,KAAI,aAC3BrB,EAAA,QAAUs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AOzD,KACP0D,EAAU7D,EAAEmC,GAAI5B,KAAI,qBAAsBiD,SAAQ,IACtDK,GAAQC,KAAK,WACX,GAAIF,EAAKH,YAAWzD,EAAGG,SAAWwD,EAEhC,MADA3D,GAAEG,MAAMe,IAAG,SACJ,KAIb6C,eAAgB,SAAS5B,EAAId,GACvBA,EAAK2C,eAAc,UACrB7D,KAAKuD,SAASvB,EAAId,EAAKsC,QAE3BM,UAAW,SAAS9B,EAAI+B,GAItBlE,EAAEmC,GAAItB,GAAE,6BAA+B,WACrCqD,OAGJC,YAAa,SAAShC,GACpBnC,EAAEmC,GAAIiC,IAAG,yBAEXX,YAAa,SAASF,GACpB,MAAOA,GAAOR,KAAI,iBAGtBjB,MAAMuC,cAAclB,SAASC,EAAqB,8BCzClD,IAAIkB,GAA+B,GAAIxC,OAAMuB,YAC7CrD,GAAEgC,OAAOsC,GACP/D,KAAM,SAAS0B,GACb,MAAOjC,GAAEiC,GAAO1B,KAAI,iBAAkBa,SAExCmD,MAAO,SAASpC,GACd,MAAO,oBAETmB,SAAU,SAASnB,GACjB,MAAOnC,GAAEmC,GAAIY,KAAI,mBAEnBW,SAAU,SAASvB,EAAIwB,GACrB3D,EAAEmC,GAAIY,KAAI,iBAAmBY,IAE/BhC,YAAa,SAASQ,GACpB,GAAIqC,GAAUrE,KAAKmD,SAASnB,GACxBsC,EAAsB,SAAZD,EAAsB,QAAU,MAC9CrE,MAAKuD,SAASvB,EAAIsC,IAEpBV,eAAgB,SAAS5B,EAAId,GACvBA,EAAK2C,eAAc,UACrB7D,KAAKuD,SAASvB,EAAId,EAAKsC,QAE3BM,UAAW,SAAS9B,EAAI+B,GACtBlE,EAAEmC,GAAItB,GAAE,sCAAwC,WAC9CqD,OAGJC,YAAa,SAAShC,GACpBnC,EAAEmC,GAAIiC,IAAG,oCAGbtC,MAAMuC,cAAclB,SAASmB,EAC3B","file":"shinydashboard.min.js","sourcesContent":["//---------------------------------------------------------------------\n// Source file: ../srcjs/_start.js\n\n$(function() {\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/tabs.js\n\n// This function handles a special case in the AdminLTE sidebar: when there\n// is a sidebar-menu with items, and one of those items has sub-items, and\n// they are used for tab navigation. Normally, if one of the items is\n// selected and then a sub-item is clicked, both the item and sub-item will\n// retain the \"active\" class, so they will both be highlighted. This happens\n// because they're not designed to be used together for tab panels. This\n// code ensures that only one item will have the \"active\" class.\nvar deactivateOtherTabs = function() {\n var $this = $(this);\n var $sidebarMenu = $this.closest(\"ul.sidebar-menu\");\n\n // Find all tab links under sidebar-menu\n var $tablinks = $sidebarMenu.find(\"a[data-toggle='tab']\");\n\n // If any other items are active, deactivate them\n $tablinks.not($this).parent(\"li\").removeClass(\"active\");\n\n // Trigger event for the tabItemInputBinding\n $sidebarMenu.trigger('change.tabItemInputBinding');\n};\n\n$(document).on('shown.bs.tab', '.sidebar-menu a[data-toggle=\"tab\"]',\n deactivateOtherTabs);\n\n\n// When document is ready, if there is a sidebar menu with no activated tabs,\n// activate the one specified by `data-start-selected`, or if that's not\n// present, the first one.\nvar ensureActivatedTab = function() {\n var $tablinks = $(\"ul.sidebar-menu\").find(\"a\").filter(\"[data-toggle='tab']\");\n\n // If there's a `data-start-selected` attribute and we can find a tab with\n // that name, activate it.\n var $startTab = $tablinks.filter(\"[data-start-selected='1']\");\n if ($startTab.length !== 0) {\n $startTab.tab(\"show\");\n return;\n }\n\n // If we got this far, just activate the first tab.\n if (! $tablinks.parent(\"li\").hasClass(\"active\") ) {\n $tablinks.first().tab(\"show\");\n }\n};\n\nensureActivatedTab();\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/sidebar.js\n\n// Optionally disable sidebar (set through the `disable` argument\n// to the `dashboardSidebar` function)\nif ($(\"section.sidebar\").data(\"disable\")) {\n $(\"body\").addClass(\"sidebar-collapse\");\n $(\".navbar > .sidebar-toggle\").hide();\n}\n\n// Whenever the sidebar expand/collapse button is clicked:\n$(document).on(\"click\", \".sidebar-toggle\", function() {\n // 1) Trigger the resize event (so images are responsive and resize)\n $(window).trigger(\"resize\");\n\n // 2) Update the value for the sidebar's input binding\n var $obj = $('.main-sidebar.shiny-bound-input');\n var inputBinding = $obj.data('shiny-input-binding');\n inputBinding.toggleValue($obj);\n $obj.trigger('change');\n});\n\n$(document).on(\"click\", \".treeview > a\", function() {\n $(this).next(\".treeview-menu\").trigger(\"shown\");\n});\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/output_binding_menu.js\n\n/* global Shiny */\n\n// menuOutputBinding\n// ------------------------------------------------------------------\n// Based on Shiny.htmlOutputBinding, but instead of putting the result in a\n// wrapper div, it replaces the origin DOM element with the new DOM elements,\n// copying over the ID and class.\nvar menuOutputBinding = new Shiny.OutputBinding();\n$.extend(menuOutputBinding, {\n find: function(scope) {\n return $(scope).find('.shinydashboard-menu-output');\n },\n onValueError: function(el, err) {\n Shiny.unbindAll(el);\n this.renderError(el, err);\n },\n renderValue: function(el, data) {\n Shiny.unbindAll(el);\n\n var html;\n var dependencies = [];\n if (data === null) {\n return;\n } else if (typeof(data) === 'string') {\n html = data;\n } else if (typeof(data) === 'object') {\n html = data.html;\n dependencies = data.deps;\n }\n\n var $html = $($.parseHTML(html));\n\n // Convert the inner contents to HTML, and pass to renderHtml\n Shiny.renderHtml($html.html(), el, dependencies);\n\n // Extract class of wrapper, and add them to the wrapper element\n el.className = 'shinydashboard-menu-output shiny-bound-output ' +\n $html.attr('class');\n\n Shiny.initializeInputs(el);\n Shiny.bindAll(el);\n ensureActivatedTab(); // eslint-disable-line\n }\n});\nShiny.outputBindings.register(menuOutputBinding,\n \"shinydashboard.menuOutputBinding\");\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/input_binding_tabItem.js\n\n/* global Shiny */\n\n// tabItemInputBinding\n// ------------------------------------------------------------------\n// Based on Shiny.tabItemInputBinding, but customized for tabItems in\n// shinydashboard, which have a slightly different structure.\nvar tabItemInputBinding = new Shiny.InputBinding();\n$.extend(tabItemInputBinding, {\n find: function(scope) {\n return $(scope).find('ul.sidebar-menu');\n },\n getValue: function(el) {\n var anchor = $(el).find('li:not(.treeview).active').children('a');\n if (anchor.length === 1)\n return this._getTabName(anchor);\n\n return null;\n },\n setValue: function(el, value) {\n var self = this;\n var anchors = $(el).find('li:not(.treeview)').children('a');\n anchors.each(function() { // eslint-disable-line consistent-return\n if (self._getTabName($(this)) === value) {\n $(this).tab('show');\n return false;\n }\n });\n },\n receiveMessage: function(el, data) {\n if (data.hasOwnProperty('value'))\n this.setValue(el, data.value);\n },\n subscribe: function(el, callback) {\n // This event is triggered by deactivateOtherTabs, which is triggered by\n // shown. The deactivation of other tabs must occur before Shiny gets the\n // input value.\n $(el).on('change.tabItemInputBinding', function() {\n callback();\n });\n },\n unsubscribe: function(el) {\n $(el).off('.tabItemInputBinding');\n },\n _getTabName: function(anchor) {\n return anchor.attr('data-value');\n }\n});\nShiny.inputBindings.register(tabItemInputBinding, 'shinydashboard.tabItemInput');\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/input_binding_sidebarCollapsed.js\n\n/* global Shiny */\n\n// sidebarCollapsedInputBinding\n// ------------------------------------------------------------------\n// This keeps tracks of whether the sidebar is expanded (default)\n// or collapsed\nvar sidebarCollapsedInputBinding = new Shiny.InputBinding();\n$.extend(sidebarCollapsedInputBinding, {\n find: function(scope) {\n return $(scope).find('.main-sidebar').first();\n },\n getId: function(el) {\n return \"sidebarCollapsed\";\n },\n getValue: function(el) {\n return $(el).attr(\"data-collapsed\");\n },\n setValue: function(el, value) {\n $(el).attr(\"data-collapsed\", value);\n },\n toggleValue: function(el) {\n var current = this.getValue(el);\n var newVal = (current === \"true\") ? \"false\" : \"true\";\n this.setValue(el, newVal);\n },\n receiveMessage: function(el, data) {\n if (data.hasOwnProperty('value'))\n this.setValue(el, data.value);\n },\n subscribe: function(el, callback) {\n $(el).on('change.sidebarCollapsedInputBinding', function() {\n callback();\n });\n },\n unsubscribe: function(el) {\n $(el).off('.sidebarCollapsedInputBinding');\n }\n});\nShiny.inputBindings.register(sidebarCollapsedInputBinding,\n 'shinydashboard.sidebarCollapsedInputBinding');\n"]} \ No newline at end of file +{"version":3,"sources":["../srcjs/_start.js","../srcjs/tabs.js","../srcjs/sidebar.js","../srcjs/output_binding_menu.js","../srcjs/input_binding_tabItem.js","../srcjs/input_binding_sidebarCollapsed.js","../srcjs/input_binding_sidebarmenuExpanded.js"],"names":["$","deactivateOtherTabs","$tablinks","not","this","parent","removeClass","$obj","inputBinding","data","setValue","attr","trigger","document","on","ensureActivatedTab","$startTab","filter","length","tab","hasClass","first","addClass","hide","window","toggleValue","$menu","next","setTimeout","menuOutputBinding","Shiny","OutputBinding","extend","find","scope","onValueError","el","err","unbindAll","renderError","renderValue","html","dependencies","deps","$html","parseHTML","renderHtml","className","initializeInputs","bindAll","outputBindings","register","tabItemInputBinding","InputBinding","getValue","value","self","anchors","children","each","_getTabName","receiveMessage","hasOwnProperty","subscribe","callback","unsubscribe","off","anchor","inputBindings","sidebarCollapsedInputBinding","getId","current","newVal","sidebarmenuExpandedInputBinding","$open"],"mappings":";;AAGAA,EAAE,WCOF,GAAIC,GAAsB,WAGxB,GAAIC,GAAYF,EAAA,mEAIhBE,GAAUC,IAAGH,EAAGI,OAAOC,OAAM,MAAOC,YAAW,SAG/C,IAAIC,GAAOP,EAAA,+BACPQ,EAAeD,EAAKE,KAAI,sBACA,oBAAjBD,KACTA,EAAaE,SAAQH,EAAOP,EAAEI,MAAMO,KAAI,eACxCJ,EAAKK,QAAO,WAIhBZ,GAAEa,UAAUC,GAAE,eAAiB,qCAChBb,EAKf,IAAIc,GAAqB,WACvB,GAAIb,GAAYF,EAAA,sCAIZgB,EAAYd,EAAUe,OAAM,4BAChC,OAAyB,KAAtBD,EAAWE,WACZF,GAAUG,IAAG,aAKTjB,EAAUG,OAAM,MAAOe,SAAQ,YACnClB,EAAUmB,QAAQF,IAAG,QACrBnB,EAAA,+BAAiCW,KAAI,aACnCT,EAAUmB,QAAQV,KAAI,iBAI5BI,KChDGf,EAAA,mBA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W,SAAS3B,EAAI4B,GACtBhE,EAAEoC,GAAItB,GAAE,sCAAwC,WAC9CkD,OAGJC,YAAa,SAAS7B,GACpBpC,EAAEoC,GAAI8B,IAAG,oCAGbpC,MAAMsC,cAAcjB,SAASkB,EAC3B,8CClCF,IAAII,GAAkC,GAAI3C,OAAMuB,YAChDrD,GAAEgC,OAAOyC,GACPxC,KAAM,SAASC,GACb,MAAOlC,GAAEkC,GAAOD,KAAI,oBAEtBqC,MAAO,SAASlC,GACd,MAAO,uBAETkB,SAAU,SAASlB,GACjB,GAAIsC,GAAQ1E,EAAEoC,GAAIH,KAAI,kBACtB,OAAqB,KAAlByC,EAAOxD,OAAqBwD,EAAM/D,KAAI,iBAC7B,MAEdoD,UAAW,SAAS3B,EAAI4B,GACtBhE,EAAEoC,GAAItB,GAAE,yCAA2C,WACjDkD,OAGJC,YAAa,SAAS7B,GACpBpC,EAAEoC,GAAI8B,IAAG,uCAGbpC,MAAMsC,cAAcjB,SAASsB,EAC3B","file":"shinydashboard.min.js","sourcesContent":["//---------------------------------------------------------------------\n// Source file: ../srcjs/_start.js\n\n$(function() {\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/tabs.js\n\n// This function handles a special case in the AdminLTE sidebar: when there\n// is a sidebar-menu with items, and one of those items has sub-items, and\n// they are used for tab navigation. Normally, if one of the items is\n// selected and then a sub-item is clicked, both the item and sub-item will\n// retain the \"active\" class, so they will both be highlighted. This happens\n// because they're not designed to be used together for tab panels. This\n// code ensures that only one item will have the \"active\" class.\nvar deactivateOtherTabs = function() {\n // Find all tab links under sidebar-menu even if they don't have a\n // tabName (which is why the second selector is necessary)\n var $tablinks = $(\".sidebar-menu a[data-toggle='tab'],\" +\n \".sidebar-menu li.treeview > a\");\n\n // If any other items are active, deactivate them\n $tablinks.not($(this)).parent(\"li\").removeClass(\"active\");\n\n // Trigger event for the tabItemInputBinding\n var $obj = $('.sidebarMenuSelectedTabItem');\n var inputBinding = $obj.data('shiny-input-binding');\n if (typeof inputBinding !== 'undefined') {\n inputBinding.setValue($obj, $(this).attr('data-value'));\n $obj.trigger('change');\n }\n};\n\n$(document).on('shown.bs.tab', '.sidebar-menu a[data-toggle=\"tab\"]',\n deactivateOtherTabs);\n\n// When document is ready, if there is a sidebar menu with no activated tabs,\n// activate the one specified by `data-start-selected`, or if that's not\n// present, the first one.\nvar ensureActivatedTab = function() {\n var $tablinks = $(\".sidebar-menu a[data-toggle='tab']\");\n\n // If there's a `data-start-selected` attribute and we can find a tab with\n // that name, activate it.\n var $startTab = $tablinks.filter(\"[data-start-selected='1']\");\n if ($startTab.length !== 0) {\n $startTab.tab(\"show\");\n return;\n }\n\n // If we got this far, just activate the first tab.\n if (! $tablinks.parent(\"li\").hasClass(\"active\") ) {\n $tablinks.first().tab(\"show\");\n $(\".sidebarMenuSelectedTabItem\").attr(\"data-value\",\n $tablinks.first().attr(\"data-value\"));\n }\n};\n\nensureActivatedTab();\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/sidebar.js\n\n// Optionally disable sidebar (set through the `disable` argument\n// to the `dashboardSidebar` function)\nif ($(\"section.sidebar\").data(\"disable\")) {\n $(\"body\").addClass(\"sidebar-collapse\");\n $(\".navbar > .sidebar-toggle\").hide();\n}\n\n// Whenever the sidebar expand/collapse button is clicked:\n$(document).on(\"click\", \".sidebar-toggle\", function() {\n // 1) Trigger the resize event (so images are responsive and resize)\n $(window).trigger(\"resize\");\n\n // 2) Update the value for the sidebar's input binding\n var $obj = $('.main-sidebar.shiny-bound-input');\n var inputBinding = $obj.data('shiny-input-binding');\n inputBinding.toggleValue($obj);\n $obj.trigger('change');\n});\n\n// Whenever we expand a menuItem (to be expandable, it must have children),\n// update the value for the expandedItem's input binding (this is the\n// tabName of the fist subMenuItem inside the menuItem that is currently\n// expanded)\n$(document).on(\"click\", \".treeview > a\", function() {\n var $menu = $(this).next();\n // If this menuItem was already open, then clicking on it again,\n // should trigger the \"hidden\" event, so Shiny doesn't worry about\n // it while it's hidden (and vice versa).\n if ($menu.hasClass(\"menu-open\")) $menu.trigger(\"hidden\");\n else if ($menu.hasClass(\"treeview-menu\")) $menu.trigger(\"shown\");\n\n // need to set timeout to account for the slideUp/slideDown animation\n var $obj = $('section.sidebar.shiny-bound-input');\n setTimeout(function() { $obj.trigger('change'); }, 600);\n});\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/output_binding_menu.js\n\n/* global Shiny */\n\n// menuOutputBinding\n// ------------------------------------------------------------------\n// Based on Shiny.htmlOutputBinding, but instead of putting the result in a\n// wrapper div, it replaces the origin DOM element with the new DOM elements,\n// copying over the ID and class.\nvar menuOutputBinding = new Shiny.OutputBinding();\n$.extend(menuOutputBinding, {\n find: function(scope) {\n return $(scope).find('.shinydashboard-menu-output');\n },\n onValueError: function(el, err) {\n Shiny.unbindAll(el);\n this.renderError(el, err);\n },\n renderValue: function(el, data) {\n Shiny.unbindAll(el);\n\n var html;\n var dependencies = [];\n if (data === null) {\n return;\n } else if (typeof(data) === 'string') {\n html = data;\n } else if (typeof(data) === 'object') {\n html = data.html;\n dependencies = data.deps;\n }\n\n var $html = $($.parseHTML(html));\n\n // Convert the inner contents to HTML, and pass to renderHtml\n Shiny.renderHtml($html.html(), el, dependencies);\n\n // Extract class of wrapper, and add them to the wrapper element\n el.className = 'shinydashboard-menu-output shiny-bound-output ' +\n $html.attr('class');\n\n Shiny.initializeInputs(el);\n Shiny.bindAll(el);\n ensureActivatedTab(); // eslint-disable-line\n }\n});\nShiny.outputBindings.register(menuOutputBinding,\n \"shinydashboard.menuOutputBinding\");\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/input_binding_tabItem.js\n\n/* global Shiny */\n\n// tabItemInputBinding\n// ------------------------------------------------------------------\n// Based on Shiny.tabItemInputBinding, but customized for tabItems in\n// shinydashboard, which have a slightly different structure.\nvar tabItemInputBinding = new Shiny.InputBinding();\n$.extend(tabItemInputBinding, {\n find: function(scope) {\n return $(scope).find('.sidebarMenuSelectedTabItem');\n },\n getValue: function(el) {\n var value = $(el).attr('data-value');\n if (value === \"null\") return null;\n return value;\n },\n setValue: function(el, value) {\n var self = this;\n var anchors = $(el).parent('ul.sidebar-menu').find('li:not(.treeview)').children('a');\n anchors.each(function() { // eslint-disable-line consistent-return\n if (self._getTabName($(this)) === value) {\n $(this).tab('show');\n $(el).attr('data-value', self._getTabName($(this)));\n return false;\n }\n });\n },\n receiveMessage: function(el, data) {\n if (data.hasOwnProperty('value'))\n this.setValue(el, data.value);\n },\n subscribe: function(el, callback) {\n // This event is triggered by deactivateOtherTabs, which is triggered by\n // shown. The deactivation of other tabs must occur before Shiny gets the\n // input value.\n $(el).on('change.tabItemInputBinding', function() {\n callback();\n });\n },\n unsubscribe: function(el) {\n $(el).off('.tabItemInputBinding');\n },\n _getTabName: function(anchor) {\n return anchor.attr('data-value');\n }\n});\n\nShiny.inputBindings.register(tabItemInputBinding, 'shinydashboard.tabItemInput');\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/input_binding_sidebarCollapsed.js\n\n/* global Shiny */\n\n// sidebarCollapsedInputBinding\n// ------------------------------------------------------------------\n// This keeps tracks of whether the sidebar is expanded (default)\n// or collapsed\nvar sidebarCollapsedInputBinding = new Shiny.InputBinding();\n$.extend(sidebarCollapsedInputBinding, {\n find: function(scope) {\n return $(scope).find('.main-sidebar').first();\n },\n getId: function(el) {\n return \"sidebarCollapsed\";\n },\n getValue: function(el) {\n return $(el).attr(\"data-collapsed\");\n },\n setValue: function(el, value) {\n $(el).attr(\"data-collapsed\", value);\n },\n toggleValue: function(el) {\n var current = this.getValue(el);\n var newVal = (current === \"true\") ? \"false\" : \"true\";\n this.setValue(el, newVal);\n },\n receiveMessage: function(el, data) {\n if (data.hasOwnProperty('value'))\n this.setValue(el, data.value);\n },\n subscribe: function(el, callback) {\n $(el).on('change.sidebarCollapsedInputBinding', function() {\n callback();\n });\n },\n unsubscribe: function(el) {\n $(el).off('.sidebarCollapsedInputBinding');\n }\n});\nShiny.inputBindings.register(sidebarCollapsedInputBinding,\n 'shinydashboard.sidebarCollapsedInputBinding');\n","//---------------------------------------------------------------------\n// Source file: ../srcjs/input_binding_sidebarmenuExpanded.js\n\n/* global Shiny */\n\n// sidebarmenuExpandedInputBinding\n// ------------------------------------------------------------------\n// This keeps tracks of what menuItem (if any) is expanded\nvar sidebarmenuExpandedInputBinding = new Shiny.InputBinding();\n$.extend(sidebarmenuExpandedInputBinding, {\n find: function(scope) {\n return $(scope).find('section.sidebar');\n },\n getId: function(el) {\n return \"sidebarItemExpanded\";\n },\n getValue: function(el) {\n var $open = $(el).find('li ul.menu-open');\n if ($open.length === 1) return $open.attr('data-expanded');\n else return null;\n },\n subscribe: function(el, callback) {\n $(el).on('change.sidebarmenuExpandedInputBinding', function() {\n callback();\n });\n },\n unsubscribe: function(el) {\n $(el).off('.sidebarmenuExpandedInputBinding');\n }\n});\nShiny.inputBindings.register(sidebarmenuExpandedInputBinding,\n 'shinydashboard.sidebarmenuExpandedInputBinding');\n"]} \ No newline at end of file diff --git a/man/sidebarMenu.Rd b/man/sidebarMenu.Rd index 1e04fa4e..cb85f30e 100644 --- a/man/sidebarMenu.Rd +++ b/man/sidebarMenu.Rd @@ -9,7 +9,9 @@ sidebarMenu(..., id = NULL, .list = NULL) menuItem(text, ..., icon = NULL, badgeLabel = NULL, badgeColor = "green", - tabName = NULL, href = NULL, newtab = TRUE, selected = NULL) + 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) @@ -49,6 +51,15 @@ browser tab?} \item{selected}{If \code{TRUE}, this \code{menuItem} or \code{menuSubItem} will start selected. If no item have \code{selected=TRUE}, then the first \code{menuItem} will start selected.} + +\item{expandedName}{A unique name given to each \code{menuItem} that serves +to indicate which one (if any) is currently expanded. (This is only applicable +to \code{menuItem}s that have children and it is mostly only useful for +bookmarking state.)} + +\item{startExpanded}{Should this \code{menuItem} be expanded on app startup? +(This is only applicable to \code{menuItem}s that have children, and only +one of these can be expanded at any given time).} } \description{ A \code{dashboardSidebar} can contain a \code{sidebarMenu}. A diff --git a/srcjs/input_binding_sidebarmenuExpanded.js b/srcjs/input_binding_sidebarmenuExpanded.js new file mode 100644 index 00000000..edaaf51d --- /dev/null +++ b/srcjs/input_binding_sidebarmenuExpanded.js @@ -0,0 +1,29 @@ +/* global Shiny */ + +// sidebarmenuExpandedInputBinding +// ------------------------------------------------------------------ +// This keeps tracks of what menuItem (if any) is expanded +var sidebarmenuExpandedInputBinding = new Shiny.InputBinding(); +$.extend(sidebarmenuExpandedInputBinding, { + find: function(scope) { + return $(scope).find('section.sidebar'); + }, + getId: function(el) { + return "sidebarItemExpanded"; + }, + getValue: function(el) { + var $open = $(el).find('li ul.menu-open'); + if ($open.length === 1) return $open.attr('data-expanded'); + else return null; + }, + subscribe: function(el, callback) { + $(el).on('change.sidebarmenuExpandedInputBinding', function() { + callback(); + }); + }, + unsubscribe: function(el) { + $(el).off('.sidebarmenuExpandedInputBinding'); + } +}); +Shiny.inputBindings.register(sidebarmenuExpandedInputBinding, + 'shinydashboard.sidebarmenuExpandedInputBinding'); diff --git a/srcjs/input_binding_tabItem.js b/srcjs/input_binding_tabItem.js index 9335511e..3aa8cbaa 100644 --- a/srcjs/input_binding_tabItem.js +++ b/srcjs/input_binding_tabItem.js @@ -7,21 +7,20 @@ var tabItemInputBinding = new Shiny.InputBinding(); $.extend(tabItemInputBinding, { find: function(scope) { - return $(scope).find('ul.sidebar-menu'); + return $(scope).find('.sidebarMenuSelectedTabItem'); }, getValue: function(el) { - var anchor = $(el).find('li:not(.treeview).active').children('a'); - if (anchor.length === 1) - return this._getTabName(anchor); - - return null; + var value = $(el).attr('data-value'); + if (value === "null") return null; + return value; }, setValue: function(el, value) { var self = this; - var anchors = $(el).find('li:not(.treeview)').children('a'); + var anchors = $(el).parent('ul.sidebar-menu').find('li:not(.treeview)').children('a'); anchors.each(function() { // eslint-disable-line consistent-return if (self._getTabName($(this)) === value) { $(this).tab('show'); + $(el).attr('data-value', self._getTabName($(this))); return false; } }); @@ -45,4 +44,5 @@ $.extend(tabItemInputBinding, { return anchor.attr('data-value'); } }); + Shiny.inputBindings.register(tabItemInputBinding, 'shinydashboard.tabItemInput'); diff --git a/srcjs/sidebar.js b/srcjs/sidebar.js index dd03bbc0..306e9716 100644 --- a/srcjs/sidebar.js +++ b/srcjs/sidebar.js @@ -17,6 +17,19 @@ $(document).on("click", ".sidebar-toggle", function() { $obj.trigger('change'); }); +// Whenever we expand a menuItem (to be expandable, it must have children), +// update the value for the expandedItem's input binding (this is the +// tabName of the fist subMenuItem inside the menuItem that is currently +// expanded) $(document).on("click", ".treeview > a", function() { - $(this).next(".treeview-menu").trigger("shown"); + var $menu = $(this).next(); + // If this menuItem was already open, then clicking on it again, + // should trigger the "hidden" event, so Shiny doesn't worry about + // it while it's hidden (and vice versa). + if ($menu.hasClass("menu-open")) $menu.trigger("hidden"); + else if ($menu.hasClass("treeview-menu")) $menu.trigger("shown"); + + // need to set timeout to account for the slideUp/slideDown animation + var $obj = $('section.sidebar.shiny-bound-input'); + setTimeout(function() { $obj.trigger('change'); }, 600); }); diff --git a/srcjs/tabs.js b/srcjs/tabs.js index 63def6f3..4b6570b0 100644 --- a/srcjs/tabs.js +++ b/srcjs/tabs.js @@ -6,28 +6,31 @@ // because they're not designed to be used together for tab panels. This // code ensures that only one item will have the "active" class. var deactivateOtherTabs = function() { - var $this = $(this); - var $sidebarMenu = $this.closest("ul.sidebar-menu"); - - // Find all tab links under sidebar-menu - var $tablinks = $sidebarMenu.find("a[data-toggle='tab']"); + // Find all tab links under sidebar-menu even if they don't have a + // tabName (which is why the second selector is necessary) + var $tablinks = $(".sidebar-menu a[data-toggle='tab']," + + ".sidebar-menu li.treeview > a"); // If any other items are active, deactivate them - $tablinks.not($this).parent("li").removeClass("active"); + $tablinks.not($(this)).parent("li").removeClass("active"); // Trigger event for the tabItemInputBinding - $sidebarMenu.trigger('change.tabItemInputBinding'); + var $obj = $('.sidebarMenuSelectedTabItem'); + var inputBinding = $obj.data('shiny-input-binding'); + if (typeof inputBinding !== 'undefined') { + inputBinding.setValue($obj, $(this).attr('data-value')); + $obj.trigger('change'); + } }; $(document).on('shown.bs.tab', '.sidebar-menu a[data-toggle="tab"]', deactivateOtherTabs); - // When document is ready, if there is a sidebar menu with no activated tabs, // activate the one specified by `data-start-selected`, or if that's not // present, the first one. var ensureActivatedTab = function() { - var $tablinks = $("ul.sidebar-menu").find("a").filter("[data-toggle='tab']"); + var $tablinks = $(".sidebar-menu a[data-toggle='tab']"); // If there's a `data-start-selected` attribute and we can find a tab with // that name, activate it. @@ -40,6 +43,8 @@ var ensureActivatedTab = function() { // If we got this far, just activate the first tab. if (! $tablinks.parent("li").hasClass("active") ) { $tablinks.first().tab("show"); + $(".sidebarMenuSelectedTabItem").attr("data-value", + $tablinks.first().attr("data-value")); } }; diff --git a/tools/Gruntfile.js b/tools/Gruntfile.js index 8ce893ba..0e9d239a 100644 --- a/tools/Gruntfile.js +++ b/tools/Gruntfile.js @@ -40,6 +40,7 @@ module.exports = function(grunt) { srcdirjs + 'output_binding_menu.js', srcdirjs + 'input_binding_tabItem.js', srcdirjs + 'input_binding_sidebarCollapsed.js', + srcdirjs + 'input_binding_sidebarmenuExpanded.js', srcdirjs + '_end.js' ], dest: destdirjs + 'shinydashboard.js' @@ -110,6 +111,7 @@ module.exports = function(grunt) { srcdirjs + 'output_binding_menu.js', srcdirjs + 'input_binding_tabItem.js', srcdirjs + 'input_binding_sidebarCollapsed.js', + srcdirjs + 'input_binding_sidebarmenuExpanded.js' ] },