Show turn restriction editor for any intersection

This commit is contained in:
John Firebaugh
2014-05-15 14:33:29 -07:00
parent f39ae89177
commit 3b26e8d511
4 changed files with 11 additions and 8 deletions
-3
View File
@@ -4245,9 +4245,6 @@
"tags": {
"highway": "traffic_signals"
},
"fields": [
"restrictions"
],
"terms": [
"light",
"stoplight",
@@ -5,9 +5,6 @@
"tags": {
"highway": "traffic_signals"
},
"fields": [
"restrictions"
],
"terms": [
"light",
"stoplight",
+6 -1
View File
@@ -31,7 +31,12 @@ iD.ui.Inspector = function(context) {
var $presetPane = $wrap.select('.preset-list-pane');
var $editorPane = $wrap.select('.entity-editor-pane');
var showEditor = state === 'hover' || context.entity(entityID).isUsed(context.graph());
var graph = context.graph(),
entity = context.entity(entityID),
showEditor = state === 'hover' ||
entity.isUsed(graph) ||
entity.isIntersection(graph);
if (showEditor) {
$wrap.style('right', '0%');
$editorPane.call(entityEditor);
+5 -1
View File
@@ -72,6 +72,10 @@ iD.ui.preset = function(context) {
}
});
if (geometry === 'vertex' && entity.isIntersection(context.graph())) {
fields.push(UIField(context.presets().field('restrictions'), entity, true));
}
context.presets().universal().forEach(function(field) {
if (preset.fields.indexOf(field) < 0) {
fields.push(UIField(field, entity));
@@ -177,7 +181,7 @@ iD.ui.preset = function(context) {
function show(field) {
field.show = true;
presets(selection);
context.presets()(selection);
field.input.focus();
}