Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions dist/bootstrap-toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,17 @@
return this.generateNavEl(anchor, text);
},

// Find the first heading level (`<h1>`, then `<h2>`, etc.) that has more than one element. Defaults to 1 (for `<h1>`).
// Find the first heading level (`<h1>`, then `<h2>`, etc.) that has more than one element. Defaults to 2 (for `<h2>`).
// Don't display h1 in the toc and allow displaying only one element.
getTopLevel: function($scope) {
for (var i = 1; i <= 6; i++) {
for (var i = 2; i <= 6; i++) {
var $headings = this.findOrFilter($scope, "h" + i);
if ($headings.length > 1) {
if ($headings.length >= 1) {
return i;
}
}

return 1;
return 2;
},

// returns the elements for the top level, and the next below it
Expand Down
2 changes: 1 addition & 1 deletion dist/bootstrap-toc.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.