From f7fcf37197d39fe205f8e0145603f8122ce57ad2 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 29 Nov 2012 09:35:48 -0500 Subject: [PATCH] Fix deletion, make active class clearer, refocus on DC, fix friendlyName --- css/map.css | 4 ++-- js/id/format/xml.js | 4 ++-- js/id/graph/history.js | 4 +++- js/id/id.js | 2 +- js/id/util.js | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/css/map.css b/css/map.css index 3e097f56c..5b33e4b71 100644 --- a/css/map.css +++ b/css/map.css @@ -50,8 +50,8 @@ path.casing:hover { } path.casing.active { - stroke:#FFF9C9 !important; - stroke-opacity:1 !important; + stroke:#E96666 !important; + opacity:1 !important; stroke-width:10 !important; } diff --git a/js/id/format/xml.js b/js/id/format/xml.js index 1c983bbd5..16bc0942c 100644 --- a/js/id/format/xml.js +++ b/js/id/format/xml.js @@ -58,12 +58,12 @@ iD.format.XML = { return x; }).map(iD.format.XML.rep)), modify: changes.modify.map(function(c) { - var x = Object.create(c); + var x = iD.Entity(c); x.changeset = changeset_id; return x; }).map(iD.format.XML.rep), 'delete': changes['delete'].map(function(c) { - var x = Object.create(c); + var x = iD.Entity(c); x.changeset = changeset_id; return x; }).map(iD.format.XML.rep) diff --git a/js/id/graph/history.js b/js/id/graph/history.js index 2a828c458..8d2eb586d 100644 --- a/js/id/graph/history.js +++ b/js/id/graph/history.js @@ -70,7 +70,9 @@ iD.History.prototype = { return _.difference( _.pluck(this.stack[0].entities, 'id'), _.pluck(this.stack[this.index].entities, 'id') - ); + ).map(function(id) { + return this.stack[0].fetch(id); + }.bind(this)); }, changes: function() { diff --git a/js/id/id.js b/js/id/id.js index 793c8bd5f..1875cf78a 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -145,7 +145,7 @@ var iD = function(container) { }); var hash = iD.Hash().map(map); - if (!hash.hadHash) map.setZoom(19).setCenter([-1.49475, 51.87502]); + if (!hash.hadHash) map.setZoom(19).setCenter([-77.0198, 38.8796]); d3.select('.user').call(iD.userpanel(connection) .on('logout', connection.logout) .on('login', connection.authenticate)); diff --git a/js/id/util.js b/js/id/util.js index 918750aaa..69af16e26 100644 --- a/js/id/util.js +++ b/js/id/util.js @@ -16,7 +16,7 @@ iD.Util.trueObj = function(arr) { iD.Util.friendlyName = function(entity) { // Generate a string such as 'river' or 'Fred's House' for an entity. - if (!Object.keys(entity.tags).length) { return ''; } + if (!entity.tags || !Object.keys(entity.tags).length) { return ''; } var mainkeys = ['highway','amenity','railway','waterway'], n = [];