mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-18 14:45:12 +02:00
Fix access field
This commit is contained in:
@@ -12,9 +12,10 @@ export function access(field) {
|
||||
var wrap = selection.selectAll('.preset-input-wrap')
|
||||
.data([0]);
|
||||
|
||||
wrap.enter().append('div')
|
||||
.attr('class', 'cf preset-input-wrap')
|
||||
.append('ul');
|
||||
var divEnter = wrap.enter().append('div')
|
||||
.attr('class', 'cf preset-input-wrap');
|
||||
divEnter.append('ul')
|
||||
wrap = wrap.merge(divEnter);
|
||||
|
||||
items = wrap.select('ul').selectAll('li')
|
||||
.data(field.keys);
|
||||
@@ -41,6 +42,8 @@ export function access(field) {
|
||||
.data(access.options(d)));
|
||||
});
|
||||
|
||||
items = items.merge(enter);
|
||||
|
||||
// Update
|
||||
|
||||
wrap.selectAll('.preset-input-access')
|
||||
@@ -184,8 +187,8 @@ export function access(field) {
|
||||
return tags.access ? tags.access : field.placeholder();
|
||||
});
|
||||
|
||||
// items.selectAll('#preset-input-access-access')
|
||||
// .attr('placeholder', 'yes');
|
||||
items.selectAll('#preset-input-access-access')
|
||||
.attr('placeholder', 'yes');
|
||||
|
||||
_.forEach(placeholders[tags.highway], function(v, k) {
|
||||
items.selectAll('#preset-input-access-' + k)
|
||||
|
||||
@@ -9,11 +9,11 @@ describe('access', function() {
|
||||
it('creates inputs for a variety of modes of access', function() {
|
||||
var access = iD.ui.fields.access(field);
|
||||
selection.call(access);
|
||||
expect(selection.selectAll('.preset-access-access')[0].length).to.equal(1);
|
||||
expect(selection.selectAll('.preset-access-foot')[0].length).to.equal(1);
|
||||
expect(selection.selectAll('.preset-access-motor_vehicle')[0].length).to.equal(1);
|
||||
expect(selection.selectAll('.preset-access-bicycle')[0].length).to.equal(1);
|
||||
expect(selection.selectAll('.preset-access-horse')[0].length).to.equal(1);
|
||||
expect(selection.selectAll('.preset-access-access').size()).to.equal(1);
|
||||
expect(selection.selectAll('.preset-access-foot').size()).to.equal(1);
|
||||
expect(selection.selectAll('.preset-access-motor_vehicle').size()).to.equal(1);
|
||||
expect(selection.selectAll('.preset-access-bicycle').size()).to.equal(1);
|
||||
expect(selection.selectAll('.preset-access-horse').size()).to.equal(1);
|
||||
});
|
||||
|
||||
it('does not include "yes", "designated", "dismount" options for general access (#934), (#2213)', function() {
|
||||
|
||||
Reference in New Issue
Block a user