diff --git a/js/id/id.js b/js/id/id.js index 09e412650..f98c28f9f 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -38,7 +38,7 @@ window.iD = function(container) { .on('click', function (mode) { controller.enter(mode); }); controller.on('enter', function (entered) { - buttons.classed('active', function (mode) { return entered === mode; }); + buttons.classed('active', function (mode) { return entered.button === mode.button; }); }); var undo_buttons = bar.append('div') diff --git a/js/id/modes/add_area.js b/js/id/modes/add_area.js index 976e4c584..06857ba32 100644 --- a/js/id/modes/add_area.js +++ b/js/id/modes/add_area.js @@ -1,6 +1,7 @@ iD.modes.AddArea = function() { var mode = { id: 'add-area', + button: 'area', title: '+ Area', description: 'Add parks, buildings, lakes, or other areas to the map.' }; diff --git a/js/id/modes/add_road.js b/js/id/modes/add_road.js index da7420071..efb3db113 100644 --- a/js/id/modes/add_road.js +++ b/js/id/modes/add_road.js @@ -1,6 +1,7 @@ iD.modes.AddRoad = function() { var mode = { id: 'add-road', + button: 'road', title: '+ Road', description: 'Roads can be highways, streets, pedestrian paths, or even canals' }; diff --git a/js/id/modes/browse.js b/js/id/modes/browse.js index cff5c9af3..0e6789f77 100644 --- a/js/id/modes/browse.js +++ b/js/id/modes/browse.js @@ -1,5 +1,6 @@ iD.modes.Browse = function() { var mode = { + button: 'browse', id: 'browse', title: 'Browse', description: 'Pan and zoom the map' diff --git a/js/id/modes/draw_area.js b/js/id/modes/draw_area.js index e2ac3c634..e2eac7392 100644 --- a/js/id/modes/draw_area.js +++ b/js/id/modes/draw_area.js @@ -1,5 +1,7 @@ iD.modes.DrawArea = function(way_id) { - var mode = {}; + var mode = { + button: 'area' + }; mode.enter = function() { diff --git a/js/id/modes/draw_road.js b/js/id/modes/draw_road.js index ec644cc76..bd176a794 100644 --- a/js/id/modes/draw_road.js +++ b/js/id/modes/draw_road.js @@ -1,5 +1,7 @@ iD.modes.DrawRoad = function(way_id, direction) { - var mode = {}; + var mode = { + button: 'road' + }; mode.enter = function() { mode.map.dblclickEnable(false); diff --git a/js/id/modes/select.js b/js/id/modes/select.js index 5bc24ee77..fe18dba6d 100644 --- a/js/id/modes/select.js +++ b/js/id/modes/select.js @@ -1,5 +1,7 @@ iD.modes.Select = function (entity) { - var mode = {}, + var mode = { + button: '' + }, inspector = iD.Inspector(), dragging, target;