Fix inspector actions

This commit is contained in:
Tom MacWright
2012-12-13 15:16:54 -05:00
parent ffdf46ab93
commit a6a608499d
3 changed files with 7 additions and 18 deletions
-1
View File
@@ -36,7 +36,6 @@ window.iD = function(container) {
.call(bootstrap.tooltip().placement('bottom'))
.on('click', function (mode) { controller.enter(mode); });
map.on('move.disable-buttons', function() {
if (map.zoom() < 16) {
buttons.attr('disabled', 'disabled');
+3 -3
View File
@@ -40,10 +40,10 @@ iD.modes.Select = function (entity) {
function remove() {
switch (entity.type) {
case 'way':
mode.history.perform(iD.actions.DeleteWay(entity));
mode.history.perform(iD.actions.DeleteWay(entity.id));
break;
case 'node':
mode.history.perform(iD.actions.DeleteNode(entity));
mode.history.perform(iD.actions.DeleteNode(entity.id));
}
mode.controller.exit();
@@ -60,7 +60,7 @@ iD.modes.Select = function (entity) {
.call(inspector);
inspector.on('changeTags', function(d, tags) {
mode.history.perform(iD.actions.ChangeEntityTags(mode.history.graph().entity(d.id), tags));
mode.history.perform(iD.actions.ChangeEntityTags(d.id, tags));
}).on('changeWayDirection', function(d) {
mode.history.perform(iD.actions.ReverseWay(d));
}).on('remove', function() {
+4 -14
View File
@@ -13,19 +13,6 @@ iD.Inspector = function() {
d.type + '/' + d.osmId();
})
.text('View on OSM');
selection.append('a')
.attr({ 'class': 'permalink', href: '#' }).text('XML')
.on('click', function(d) {
d3.event.stopPropagation();
iD.util.codeWindow(iD.format.XML.mapping(d));
});
selection.append('a')
.attr({ 'class': 'permalink', href: '#' }).text('GeoJSON')
.on('click', function(d) {
d3.event.stopPropagation();
iD.util.codeWindow(JSON.stringify(
iD.format.GeoJSON.mapping(d), null, 2));
});
if (selection.datum().type === 'way') {
selection.append('a')
.attr('class', 'permalink')
@@ -104,7 +91,10 @@ iD.Inspector = function() {
// Remove any blank key-values
function clean(x) {
for (var i in x) if (!i) delete x[i];
for (var i in x) {
// undefined is cast to a string as an object key
if (!i || i === 'undefined') delete x[i];
}
return x;
}