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
5 changes: 4 additions & 1 deletion static/js/postAceInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ exports.postAceInit = () => {
}

const urlContainstocTrue = tableOfContents.getParam('toc'); // if the url param is set
if (urlContainstocTrue) {
if (urlContainstocTrue === 'true') {
optionToc.attr('checked', 'checked');
tableOfContents.enable();
} else if (urlContainstocTrue === 'false') {
optionToc.attr('checked', false);
tableOfContents.disable();
}
};
2 changes: 1 addition & 1 deletion static/js/toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const tableOfContents = {

getParam: (sname) => {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.has(sname);
return urlParams.get(sname);
},

};