Fix issue where clicking some buttons would clear the URL hash

This commit is contained in:
Quincy Morgan
2020-10-27 09:56:05 -04:00
parent 3095e76487
commit 154c6ed0ed
5 changed files with 12 additions and 7 deletions

View File

@@ -114,7 +114,6 @@ export function uiFieldCheck(field, context) {
enter
.append('button')
.attr('class', 'reverser' + (reverserHidden() ? ' hide' : ''))
.attr('href', '#')
.append('span')
.attr('class', 'reverser-span');
}

View File

@@ -104,7 +104,8 @@ export function uiSectionBackgroundDisplayOptions(context) {
.attr('class', 'display-option-resetlink')
.attr('href', '#')
.html(t.html('background.reset_all'))
.on('click', function() {
.on('click', function(d3_event) {
d3_event.preventDefault();
for (var i = 0; i < _sliders.length; i++) {
updateValue(_sliders[i], 1);
}

View File

@@ -33,7 +33,8 @@ export function uiSectionMapFeatures(context) {
.attr('class', 'feature-list-link')
.attr('href', '#')
.html(t.html('issues.disable_all'))
.on('click', function() {
.on('click', function(d3_event) {
d3_event.preventDefault();
context.features().disableAll();
});
@@ -42,7 +43,8 @@ export function uiSectionMapFeatures(context) {
.attr('class', 'feature-list-link')
.attr('href', '#')
.html(t.html('issues.enable_all'))
.on('click', function() {
.on('click', function(d3_event) {
d3_event.preventDefault();
context.features().enableAll();
});

View File

@@ -46,7 +46,8 @@ export function uiSectionValidationRules(context) {
.attr('class', 'issue-rules-link')
.attr('href', '#')
.html(t.html('issues.disable_all'))
.on('click', function() {
.on('click', function(d3_event) {
d3_event.preventDefault();
context.validator().disableRules(_ruleKeys);
});
@@ -55,7 +56,8 @@ export function uiSectionValidationRules(context) {
.attr('class', 'issue-rules-link')
.attr('href', '#')
.html(t.html('issues.enable_all'))
.on('click', function() {
.on('click', function(d3_event) {
d3_event.preventDefault();
context.validator().disableRules([]);
});

View File

@@ -80,7 +80,8 @@ export function uiSectionValidationStatus(context) {
resetIgnored.select('a')
.html(t('inspector.title_count', { title: t.html('issues.reset_ignored'), count: ignoredIssues.length }));
resetIgnored.on('click', function() {
resetIgnored.on('click', function(d3_event) {
d3_event.preventDefault();
context.validator().resetIgnoredIssues();
});
}