mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-21 07:46:58 +02:00
Restore numeric lanes preset, but keep code for new WIP lanes field
This commit is contained in:
@@ -472,6 +472,8 @@ en:
|
||||
lanes:
|
||||
# 'lanes=*'
|
||||
label: Lanes
|
||||
# lanes field placeholder
|
||||
placeholder: '1, 2, 3...'
|
||||
layer:
|
||||
# 'layer=*'
|
||||
label: Layer
|
||||
|
||||
@@ -647,8 +647,9 @@
|
||||
},
|
||||
"lanes": {
|
||||
"key": "lanes",
|
||||
"type": "lanes",
|
||||
"label": "Lanes"
|
||||
"type": "number",
|
||||
"label": "Lanes",
|
||||
"placeholder": "1, 2, 3..."
|
||||
},
|
||||
"layer": {
|
||||
"key": "layer",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"key": "lanes",
|
||||
"type": "lanes",
|
||||
"label": "Lanes"
|
||||
"type": "number",
|
||||
"label": "Lanes",
|
||||
"placeholder":"1, 2, 3..."
|
||||
}
|
||||
|
||||
Vendored
+2
-1
@@ -1046,7 +1046,8 @@
|
||||
"label": "Type"
|
||||
},
|
||||
"lanes": {
|
||||
"label": "Lanes"
|
||||
"label": "Lanes",
|
||||
"placeholder": "1, 2, 3..."
|
||||
},
|
||||
"layer": {
|
||||
"label": "Layer"
|
||||
|
||||
@@ -1238,6 +1238,51 @@
|
||||
return d3.rebind(localized, dispatch, 'on');
|
||||
}
|
||||
|
||||
function lanes(field, context) {
|
||||
var dispatch = d3.dispatch('change'),
|
||||
wayID,
|
||||
laneData;
|
||||
|
||||
function lanes(selection) {
|
||||
// if form field is hidden or has detached from dom, clean up.
|
||||
if (!d3.select('.inspector-wrap.inspector-hidden').empty() || !selection.node().parentNode) {
|
||||
selection.call(lanes.off);
|
||||
return;
|
||||
}
|
||||
|
||||
laneData = context.entity(wayID).lanes();
|
||||
|
||||
var wrap = selection.selectAll('.preset-input-wrap')
|
||||
.data([0]);
|
||||
|
||||
var enter = wrap.enter()
|
||||
.append('div')
|
||||
.attr('class', 'preset-input-wrap');
|
||||
|
||||
enter
|
||||
.append('div')
|
||||
.attr('class', 'lane-count')
|
||||
.append('span');
|
||||
|
||||
selection.selectAll('.lane-count')
|
||||
.text(laneData.tagged.lanes.count || laneData.defaults.lanes.count);
|
||||
|
||||
}
|
||||
|
||||
|
||||
lanes.entity = function(_) {
|
||||
if (!wayID || wayID !== _.id) {
|
||||
wayID = _.id;
|
||||
}
|
||||
};
|
||||
|
||||
lanes.tags = function() {};
|
||||
lanes.focus = function() {};
|
||||
lanes.off = function() {};
|
||||
|
||||
return d3.rebind(lanes, dispatch, 'on');
|
||||
}
|
||||
|
||||
function maxspeed(field, context) {
|
||||
var dispatch = d3.dispatch('change'),
|
||||
entity,
|
||||
@@ -1851,6 +1896,7 @@
|
||||
exports.email = url;
|
||||
exports.tel = url;
|
||||
exports.localized = localized;
|
||||
exports.lanes = lanes;
|
||||
exports.maxspeed = maxspeed;
|
||||
exports.radio = radio;
|
||||
exports.restrictions = restrictions;
|
||||
|
||||
@@ -88,10 +88,6 @@ export function preset(context) {
|
||||
fields.push(UIField(context.presets().field('restrictions'), entity, true));
|
||||
}
|
||||
|
||||
if (entity.lanes(context.graph())) {
|
||||
fields.push(UIField(context.presets().field('lanes'), entity, true));
|
||||
}
|
||||
|
||||
context.presets().universal().forEach(function(field) {
|
||||
if (preset.fields.indexOf(field) < 0) {
|
||||
fields.push(UIField(field, entity));
|
||||
|
||||
Reference in New Issue
Block a user