fix: do not show TOC if fewer than 2 headings

v1.18.x
Julian Lam 4 years ago
parent caa8c00f89
commit f1de084da3

@ -5,7 +5,10 @@ define('admin/settings', ['uploader', 'mousetrap'], function (uploader, mousetra
var Settings = {};
Settings.populateTOC = function () {
$('.settings-header').each(function () {
var headers = $('.settings-header');
if (headers.length > 1) {
headers.each(function () {
var header = $(this).text();
var anchor = header.toLowerCase().replace(/ /g, '-').trim();
@ -19,6 +22,9 @@ define('admin/settings', ['uploader', 'mousetrap'], function (uploader, mousetra
scrollTop: (scrollTo.offset().top) + 'px',
}, 400);
}
} else {
$('.content-header').parents('.row').remove();
}
};
Settings.prepare = function (callback) {

Loading…
Cancel
Save