mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-07 03:00:20 -04:00
Fix appendTab for empty tabsetPanels (#1813)
* fix appendTab for empty tabsetPanels; use spread operator to avoid having to resort to apply; upgrade grunt. * revert back to `Math.max.apply(null, existingTabIds) + 1;` there's no browser compatibility issues there
This commit is contained in:
committed by
Winston Chang
parent
668ee6f24a
commit
650075a9ab
@@ -1749,7 +1749,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
||||
set the tab id (counter dummy) to "id" and the tabset id to "tsid")
|
||||
*/
|
||||
function getTabIndex($tabset, tabsetId) {
|
||||
var existingTabIds = [];
|
||||
// The 0 is to ensure this works for empty tabsetPanels as well
|
||||
var existingTabIds = [0];
|
||||
var leadingHref = "#tab-" + tabsetId + "-";
|
||||
// loop through all existing tabs, find the one with highest id
|
||||
// (since this is based on a numeric counter), and increment
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
inst/www/shared/shiny.min.js
vendored
2
inst/www/shared/shiny.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -880,7 +880,8 @@ var ShinyApp = function() {
|
||||
set the tab id (counter dummy) to "id" and the tabset id to "tsid")
|
||||
*/
|
||||
function getTabIndex($tabset, tabsetId) {
|
||||
var existingTabIds = [];
|
||||
// The 0 is to ensure this works for empty tabsetPanels as well
|
||||
var existingTabIds = [0];
|
||||
var leadingHref = "#tab-" + tabsetId + "-";
|
||||
// loop through all existing tabs, find the one with highest id
|
||||
// (since this is based on a numeric counter), and increment
|
||||
@@ -891,7 +892,7 @@ var ShinyApp = function() {
|
||||
existingTabIds.push(Number(index));
|
||||
}
|
||||
});
|
||||
return (Math.max.apply(null, existingTabIds) + 1);
|
||||
return Math.max.apply(null, existingTabIds) + 1;
|
||||
}
|
||||
|
||||
// Finds out if the item will be placed inside a navbarMenu
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"babel-eslint": "^6.0.0",
|
||||
"babel-preset-es2015": "^6.6.0",
|
||||
"eslint-stylish-mapped": "^1.0.0",
|
||||
"grunt": "~1.0.0",
|
||||
"grunt": "^1.0.1",
|
||||
"grunt-babel": "^6.0.0",
|
||||
"grunt-contrib-clean": "^1.0.0",
|
||||
"grunt-contrib-concat": "^1.0.0",
|
||||
|
||||
@@ -1120,7 +1120,7 @@ grunt-newer@^1.1.2:
|
||||
async "^1.5.2"
|
||||
rimraf "^2.5.2"
|
||||
|
||||
grunt@~1.0.0:
|
||||
grunt@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/grunt/-/grunt-1.0.1.tgz#e8778764e944b18f32bb0f10b9078475c9dfb56b"
|
||||
dependencies:
|
||||
|
||||
Reference in New Issue
Block a user