Merge branch 'master' of github.com:systemed/iD

This commit is contained in:
Saman Bemel-Benrud
2013-02-19 19:34:18 -05:00
9 changed files with 46 additions and 8 deletions
+16 -1
View File
@@ -1586,4 +1586,19 @@ div.combobox {
}
@media only screen and (max-height: 840px) {
}
}
/* Address input */
.preset-input .addr-housename {
width: 300px;
display: block;
}
.preset-input .addr-number {
width: 50px;
}
.preset-input .addr-streetname {
width: 250px;
}
+1
View File
@@ -93,6 +93,7 @@
<script src='js/id/ui/taglist.js'></script>
<script src='js/id/ui/presetgrid.js'></script>
<script src='js/id/ui/tageditor.js'></script>
<script src='js/id/ui/address.js'></script>
<script src='js/id/actions.js'></script>
<script src="js/id/actions/add_midpoint.js"></script>
+2 -2
View File
@@ -12,8 +12,8 @@ iD.Tree = function(graph) {
function extentRectangle(extent) {
x = m * extent[0][0],
y = m * extent[0][1],
dx = m * extent[1][0] - x || 1,
dy = m * extent[1][1] - y || 1;
dx = m * extent[1][0] - x || 2,
dy = m * extent[1][1] - y || 2;
return new RTree.Rectangle(~~x, ~~y, ~~dx - 1, ~~dy - 1);
}
+4
View File
@@ -85,3 +85,7 @@ iD.geo.pathLength = function(path) {
}
return length;
};
iD.geo.metresToCoordinates = function(loc, vector) {
return [vector[1] / 111200, vector[0] / 111200 / Math.cos(loc[1])];
};
+4 -5
View File
@@ -16,14 +16,13 @@ iD.ui.Inspector = function() {
entity = selection.datum();
var iwrap = selection
messagewrap = iwrap.append('div')
var messagewrap = selection.append('div')
.attr('class', 'message inspector-inner fillL'),
message = messagewrap.append('h3');
inspectorbody = iwrap.append('div')
inspectorbody = selection.append('div')
.attr('class', 'fillL'),
iwrap.append('div')
selection.append('div')
.attr('class', 'inspector-actions pad1 col12')
.call(drawButtons);
@@ -57,7 +56,7 @@ iD.ui.Inspector = function() {
inspectorbody.call(tagEditor);
}
iwrap.call(iD.ui.Toggle(true));
selection.call(iD.ui.Toggle(true));
}
function drawButtons(selection) {
+5
View File
@@ -134,6 +134,11 @@ iD.ui.preset = function() {
// Multiple elements, eg, address
} else {
if (d.type === 'address') {
wrap.append('div')
.attr('class', 'col8 preset-input', d)
.call(iD.ui.preset.address()
.context(context)
.entity(entity));
}
}
});
+2
View File
@@ -226,6 +226,8 @@ d3.combobox = function() {
}
function mousedown() {
input.node().focus();
update('');
var entries = container.selectAll('a'),
+4
View File
@@ -19,6 +19,10 @@
{
"key": "cuisine",
"type": "combo"
},
{
"type": "address",
"title": "Address"
}
]
},
+8
View File
@@ -52,5 +52,13 @@ describe("iD.Tree", function() {
var g = tree.graph().replace(n1).replace(n2);
expect(tree.intersects(iD.geo.Extent([0, 0], [1.1, 1.1]), g)).to.eql([n1]);
});
it("doesn't include removed entities", function() {
var n1 = iD.Node({ id: 'n1', loc: [1, 1]});
var g = tree.graph().replace(n1);
expect(tree.intersects(iD.geo.Extent([0, 0], [2, 2]), g)).to.eql([n1]);
g = g.remove(n1);
expect(tree.intersects(iD.geo.Extent([0, 0], [2, 2]), g)).to.eql([]);
});
});
});