Reorganize inspector

This commit is contained in:
Tom MacWright
2012-11-01 12:00:27 -04:00
parent affb49e3ba
commit b2e780c4c9
3 changed files with 21 additions and 17 deletions

View File

@@ -175,28 +175,34 @@ table td {
.inspector-wrap a.permalink {
text-decoration:none;
margin-right:2em;
margin-right:1em;
font: normal 11px/20px 'Helvetica'
}
.inspector thead th {
font-size:10px;
line-height:10px;
line-height:15px;
color:#999;
font-weight:normal;
text-transform:uppercase;
}
.inspector tbody td {
border: 1px solid #ccc;
}
.inspector input {
margin:0;
padding:4px;
border:0;
border-bottom:1px solid #ccc;
width:150px;
border:0;
}
.inspector input.tag-input {
box-shadow: inset -2px 0 10px #EEE
.inspector input.tag-key {
}
.inspector input.tag-value {
}
.presets h3 {

View File

@@ -150,12 +150,9 @@ iD.Map = function(parentSelector) {
return a.type === 'node';
});
var fills = fill_g.selectAll('path.area')
.data(areas, key),
casings = casing_g.selectAll('path.casing')
.data(ways, key),
strokes = stroke_g.selectAll('path.stroke')
.data(ways, key),
var fills = fill_g.selectAll('path.area').data(areas, key),
casings = casing_g.selectAll('path.casing').data(ways, key),
strokes = stroke_g.selectAll('path.stroke').data(ways, key),
markers = hit_g.selectAll('image.marker')
.data(points.filter(iD.markerimage), key);

View File

@@ -18,36 +18,37 @@ iD.Inspector = function(graph) {
.attr('class', 'permalink')
.attr('href', 'http://www.openstreetmap.org/browse/' +
d.type + '/' + d.id)
.text('#' + d.id);
.text('OSM');
head.append('a')
.attr('class', 'permalink')
.attr('href', '#')
.text(d.id + '.geojson')
.text('GeoJSON')
.on('click', function() {
iD.Util.codeWindow(
JSON.stringify(iD.GeoJSON.mapping(graph.fetch(d.id)), null, 2));
d3.event.stopPropagation();
iD.Util.codeWindow(JSON.stringify(
iD.GeoJSON.mapping(graph.fetch(d.id)), null, 2));
});
var table = d3.select(this)
.append('table')
.attr('class', 'inspector');
var tbody = table.append('tbody');
table.append('thead').append('tr').selectAll('th')
.data(['tag', 'value'])
.enter()
.append('th')
.text(String);
var tbody = table.append('tbody');
var row = tbody.selectAll('tr')
.data(d3.entries(d.tags))
.enter()
.append('tr');
row.append('td').append('input')
.attr('class', 'tag-key')
.property('value', function(d) { return d.key; })
.on('change', function(row) {
row.key = this.key;