Skip to content

Commit 1a22f6f

Browse files
committed
Add a couple comments
1 parent 5c9866c commit 1a22f6f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

theme/static/content_list.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ steal("can/control","jquery","can/observe",function(Control, $){
3333

3434
var ch = this.collectHeadings().each(function(ix) {
3535
var el = $(this);
36+
//change formatting here from default to match this:
37+
// ## This is My Heading --> <h2 id="this-is-my-heading">
3638
this.id = el.text().toLowerCase().replace(/[^\w]/g,"-").replace(/\s/g,"");
3739
var num = +this.nodeName.substr(1);
3840
var section = {
@@ -79,6 +81,7 @@ steal("can/control","jquery","can/observe",function(Control, $){
7981
return cloned;
8082
},
8183
collectHeadings: function() {
84+
//change the depth so we capture all our headings
8285
var depth = ( window.docObject.outline && window.docObject.outline.depth ) || 3;
8386
var headings = [];
8487
for(var i = 0; i < depth; i++) {
@@ -88,4 +91,4 @@ steal("can/control","jquery","can/observe",function(Control, $){
8891
}
8992
});
9093

91-
});
94+
});

0 commit comments

Comments
 (0)