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:
Barbara Borges Ribeiro
2017-08-10 00:45:25 +01:00
committed by Winston Chang
parent 668ee6f24a
commit 650075a9ab
7 changed files with 10 additions and 8 deletions

View File

@@ -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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -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

View File

@@ -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",

View File

@@ -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: