scroll to the actual subsection in the ACP when clicking on links pointing to that hash

This commit is contained in:
psychobunny
2017-08-21 18:46:03 -04:00
parent 0e219a8c58
commit e8c40c8dc6

View File

@@ -17,6 +17,13 @@ define('admin/settings', ['uploader'], function (uploader) {
$(this).prepend('<a name="' + anchor + '"></a>');
$('.section-content ul').append('<li><a href="#' + anchor + '">' + header + '</a></li>');
});
var scrollTo = $('a[name="' + window.location.hash.replace('#', '') + '"]');
if (scrollTo.length) {
$('html, body').animate({
scrollTop: (scrollTo.offset().top) + 'px',
}, 400);
}
};
Settings.prepare = function (callback) {