Skip to content

Commit e00daee

Browse files
committed
Update to prevent all empty link change hash
1 parent 3c06678 commit e00daee

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

public/js/cover.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,19 @@ $(".masthead-nav li").click(function () {
9191
$(this).addClass("active");
9292
});
9393

94-
$(".ui-home").click(function (e) {
94+
// prevent empty link change hash
95+
$('a[href="#"]').click(function (e) {
9596
e.preventDefault();
96-
e.stopPropagation();
97+
});
98+
99+
$(".ui-home").click(function (e) {
97100
if (!$("#home").is(':visible')) {
98101
$(".section:visible").hide();
99102
$("#home").fadeIn();
100103
}
101104
});
102105

103106
$(".ui-history").click(function (e) {
104-
e.preventDefault();
105-
e.stopPropagation();
106107
if (!$("#history").is(':visible')) {
107108
$(".section:visible").hide();
108109
$("#history").fadeIn();

public/js/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,6 +1754,10 @@ ui.toolbar.uploadImage.bind('change', function (e) {
17541754
ui.toc.dropdown.click(function (e) {
17551755
e.stopPropagation();
17561756
});
1757+
// prevent empty link change hash
1758+
$('a[href="#"]').click(function (e) {
1759+
e.preventDefault();
1760+
});
17571761

17581762
//modal actions
17591763
var revisions = [];

0 commit comments

Comments
 (0)