preset-input-wrap -> form-field-input-wrap

This better describes what it does.
Also, took this opportunity to update a bunch of the uifield code
(no multi line variable declarations, prefix state variables with _,
eliminate unnecessray lodash, etc)
This commit is contained in:
Bryan Housel
2018-11-27 10:54:03 -05:00
parent 7bf0af562c
commit 4533603a88
11 changed files with 147 additions and 149 deletions
+8 -10
View File
@@ -1,5 +1,3 @@
import _keys from 'lodash-es/keys';
import { dispatch as d3_dispatch } from 'd3-dispatch';
import { select as d3_select } from 'd3-selection';
import { d3combobox as d3_combobox } from '../../lib/d3.combobox.js';
@@ -12,8 +10,8 @@ import {
export function uiFieldCycleway(field, context) {
var dispatch = d3_dispatch('change'),
items = d3_select(null);
var dispatch = d3_dispatch('change');
var items = d3_select(null);
function cycleway(selection) {
@@ -23,12 +21,12 @@ export function uiFieldCycleway(field, context) {
}
var wrap = selection.selectAll('.preset-input-wrap')
var wrap = selection.selectAll('.form-field-input-wrap')
.data([0]);
wrap = wrap.enter()
.append('div')
.attr('class', 'preset-input-wrap')
.attr('class', 'form-field-input-wrap')
.merge(wrap);
@@ -77,9 +75,9 @@ export function uiFieldCycleway(field, context) {
function change() {
var left = utilGetSetValue(d3_select('.preset-input-cyclewayleft')),
right = utilGetSetValue(d3_select('.preset-input-cyclewayright')),
tag = {};
var left = utilGetSetValue(d3_select('.preset-input-cyclewayleft'));
var right = utilGetSetValue(d3_select('.preset-input-cyclewayright'));
var tag = {};
if (left === 'none' || left === '') { left = undefined; }
if (right === 'none' || right === '') { right = undefined; }
@@ -106,7 +104,7 @@ export function uiFieldCycleway(field, context) {
cycleway.options = function() {
return _keys(field.strings.options).map(function(option) {
return Object.keys(field.strings.options).map(function(option) {
return {
title: field.t('options.' + option + '.description'),
value: option