Standardize return key comments

This commit is contained in:
Quincy Morgan
2020-09-17 15:20:33 -04:00
parent b16d39452e
commit 6f2a746440
5 changed files with 11 additions and 5 deletions
+3 -1
View File
@@ -89,7 +89,9 @@ export function uiFeatureList(context) {
function keypress() {
var q = search.property('value'),
items = list.selectAll('.feature-list-item');
if (d3_event.keyCode === 13 && q.length && items.size()) { // return
if (d3_event.keyCode === 13 && // ↩ Return
q.length &&
items.size()) {
click(items.datum());
}
}
+2 -1
View File
@@ -177,7 +177,8 @@ export function uiNoteEditor(context) {
// fast submit if user presses cmd+enter
function keydown() {
if (!(d3_event.keyCode === 13 && d3_event.metaKey)) return;
if (!(d3_event.keyCode === 13 && // ↩ Return
d3_event.metaKey)) return;
var osm = services.osm;
if (!osm) return;
+2 -1
View File
@@ -85,7 +85,8 @@ export function uiPresetList(context) {
function keypress() {
// enter
var value = search.property('value');
if (d3_event.keyCode === 13 && value.length) {
if (d3_event.keyCode === 13 && // ↩ Return
value.length) {
list.selectAll('.preset-list-item:first-child')
.each(function(d) { d.choose.call(this); });
}
+3 -1
View File
@@ -127,7 +127,9 @@ export function uiSectionPresetFields(context) {
selection.selectAll('.wrap-form-field input')
.on('keydown', function() {
// if user presses enter, and combobox is not active, accept edits..
if (d3_event.keyCode === 13 && context.container().select('.combobox').empty()) {
if (d3_event.keyCode === 13 && // ↩ Return
context.container().select('.combobox').empty()) {
context.enter(modeBrowse(context));
}
});
+1 -1
View File
@@ -144,7 +144,7 @@ export function uiSectionValidationRules(context) {
this.select();
})
.on('keyup', function () {
if (d3_event.keyCode === 13) { // enter
if (d3_event.keyCode === 13) { // ↩ Return
this.blur();
this.select();
}