diff --git a/css/app.css b/css/app.css index 5ba49d344..45a3c6d0a 100644 --- a/css/app.css +++ b/css/app.css @@ -131,7 +131,15 @@ table td { #bar button.mini, #bar button.mini { - width:50px; + width:auto; +} + +button small { + display: inline-block; + font-weight: normal; + font-size: 12px; + line-height: 30px; + vertical-align: top; } #bar input[type=text] { diff --git a/index.html b/index.html index 9295cdbb8..64b11fa72 100755 --- a/index.html +++ b/index.html @@ -15,7 +15,7 @@ + Place
diff --git a/js/iD/UI.js b/js/iD/UI.js index 3977a63bf..0531e759f 100644 --- a/js/iD/UI.js +++ b/js/iD/UI.js @@ -6,4 +6,9 @@ iD.UI.bind = function() { area: d3.select('button#area'), road: d3.select('button#road') }; + + this.undoText = d3.select('button#undo small'); +}; + +iD.UI.update = function() { }; diff --git a/js/iD/actions/operations.js b/js/iD/actions/operations.js index a10d56bb3..e0f1bc73c 100644 --- a/js/iD/actions/operations.js +++ b/js/iD/actions/operations.js @@ -5,5 +5,6 @@ iD.operations.addNode = function(map, node) { var o = {}; o[node.id] = node; return graph.set(o); - }, 'Added a new unidentified place'); + }, 'added a place'); + map.update(); }; diff --git a/js/iD/graph/Node.js b/js/iD/graph/Node.js index 927d69927..e7e875763 100644 --- a/js/iD/graph/Node.js +++ b/js/iD/graph/Node.js @@ -1,3 +1,4 @@ +/* iD.Node = function(id, lat, lon, tags, loaded) { this.id = id; this.lat = lat; @@ -17,3 +18,4 @@ iD.Node.prototype = { (this.lat >= extent[1][1]); } }; +*/ diff --git a/js/iD/graph/Way.js b/js/iD/graph/Way.js index eb66c8030..e79804212 100644 --- a/js/iD/graph/Way.js +++ b/js/iD/graph/Way.js @@ -9,8 +9,7 @@ iD.Way = { isClosed: function(w) { - if (!w.nodes.length) return true; - return w.nodes[w.nodes.length - 1] === w.nodes[0]; + return (!w.nodes.length) || w.nodes[w.nodes.length - 1] === w.nodes[0]; } }; diff --git a/js/iD/renderer/Map.js b/js/iD/renderer/Map.js index 35fc8f15f..25905f9af 100755 --- a/js/iD/renderer/Map.js +++ b/js/iD/renderer/Map.js @@ -12,7 +12,7 @@ iD.Map = function(elem) { var map = {}, width, height, - dispatch = d3.dispatch('move'), + dispatch = d3.dispatch('move', 'update'), // data graph = new iD.Graph(), connection = new iD.Connection(graph), @@ -141,14 +141,12 @@ iD.Map = function(elem) { // Markers markers.exit().remove(); - markers.enter().append('image') .attr('class', class_marker) .on('click', selectClick) .attr({ width: 16, height: 16 }) .attr('xlink:href', iD.Style.markerimage) .call(dragbehavior); - markers.attr('transform', function(d) { var pt = projection([d.lon, d.lat]); pt[0] -= 8; @@ -204,8 +202,8 @@ iD.Map = function(elem) { function zoomPan() { projection - .translate(d3.event.translate) - .scale(d3.event.scale); + .translate(d3.event.translate) + .scale(d3.event.scale); redraw(); } @@ -220,6 +218,13 @@ iD.Map = function(elem) { } } + // UI elements + // ----------- + var undolabel = d3.select('button#undo small'); + dispatch.on('update', function() { + undolabel.text(graph.annotations[graph.annotations.length - 1]); + }); + // Getters & setters for map state // ------------------------------- // The map state can be expressed entirely as the combination @@ -312,10 +317,8 @@ iD.Map = function(elem) { map.graph = graph; map.surface = surface; - setSize( - parent.node().offsetWidth, - parent.node().offsetHeight); - redraw(); + setSize(parent.node().offsetWidth, parent.node().offsetHeight); + redraw(); - return d3.rebind(map, dispatch, 'on'); + return d3.rebind(map, dispatch, 'on', 'move', 'update'); };