Skip to content

Commit 6f727ad

Browse files
spraintsdscho
authored andcommitted
Remove dynamic About navigation code
This code is no longer needed in the Hugo world: clicking on About page links navigates to a separate page. In the previous, non-Hugo incarnation of this site, https://git-scm.com/about/info-assurance#staging-area would redirect to https://git-scm.com/about/staging-area. But that was awkward and we should not need to re-implement this functionality. Signed-off-by: Matt Burke <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 4374cec commit 6f727ad

File tree

1 file changed

+0
-55
lines changed

1 file changed

+0
-55
lines changed

static/js/application.js

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ $(document).ready(function() {
2727
Forms.init();
2828
Downloads.init();
2929
DownloadBox.init();
30-
AboutContent.init();
3130
});
3231

3332
function onPopState(fn) {
@@ -304,60 +303,6 @@ var Downloads = {
304303
}
305304
}
306305

307-
var AboutContent = {
308-
defaultSection: "branching-and-merging",
309-
310-
init: function() {
311-
if ($('body#about').length === 0) return;
312-
$('section.about').hide();
313-
$('section.about .bottom-nav').show();
314-
AboutContent.observeNav();
315-
AboutContent.observePopState();
316-
AboutContent.showSection(AboutContent.getSection());
317-
},
318-
319-
observePopState: function() {
320-
onPopState(function() {
321-
section = AboutContent.getSection();
322-
return AboutContent.showSection(section);
323-
});
324-
},
325-
326-
getSection: function(href) {
327-
var section;
328-
section = location.href.substring(location.href.lastIndexOf("/") + 1);
329-
if (section.length === 0 || section == 'about') {
330-
section = AboutContent.defaultSection;
331-
}
332-
return section;
333-
},
334-
335-
showSection: function(section) {
336-
if (section == 'about') section = AboutContent.defaultSection;
337-
$('ol#about-nav a').removeClass('current');
338-
$('ol#about-nav a#nav-' + section).addClass('current');
339-
$('section').hide(0, function(){
340-
$('section#' + section).show();
341-
});
342-
343-
if (section == AboutContent.defaultSection) section = 'about';
344-
$('.sidebar nav .expanded a').removeClass('active');
345-
$('.sidebar nav .expanded a[href$=' + section + ']').addClass('active')
346-
},
347-
348-
observeNav: function() {
349-
$('ol#about-nav a, .bottom-nav a').click(function(e) {
350-
e.preventDefault();
351-
var section = $(this).attr('data-section-id');
352-
353-
if (window.history && window.history.pushState) {
354-
history.pushState(null, $(this).html(), '/about/'+section);
355-
}
356-
AboutContent.showSection(section);
357-
});
358-
}
359-
}
360-
361306
// Scroll to Top
362307
$('#scrollToTop').removeClass('no-js');
363308
$(window).scroll(function() {

0 commit comments

Comments
 (0)