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
7 changes: 7 additions & 0 deletions dist/bootstrap-toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@

// accepts a jQuery object, or an options object
init: function(opts) {
// If the element has the processed class already, do not build the TOC.
if (opts.$nav.hasClass('processed')) {
return null;
}
opts = this.helpers.parseOps(opts);

// ensure that the data attribute is in place for styling
Expand All @@ -147,6 +151,9 @@
var topLevel = this.helpers.getTopLevel(opts.$scope);
var $headings = this.helpers.getHeadings(opts.$scope, topLevel);
this.helpers.populateNav($topContext, topLevel, $headings);

// Add a processed class after the TOC has been built.
opts.$nav.addClass('processed');
}
};

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.