diff --git a/css/app.css b/css/app.css index d6bc7fc5f..ce1a821b0 100644 --- a/css/app.css +++ b/css/app.css @@ -33,6 +33,12 @@ body { min-width: 768px; } +#content { + position: relative; + overflow: hidden; + height: 100%; +} + .limiter { position: relative; max-width: 1200px; diff --git a/js/id/modes/drag_node.js b/js/id/modes/drag_node.js index 6bc42ed37..cb6ee6cda 100644 --- a/js/id/modes/drag_node.js +++ b/js/id/modes/drag_node.js @@ -8,6 +8,7 @@ iD.modes.DragNode = function(context) { activeIDs, wasMidpoint, cancelled, + selection = [], hover = iD.behavior.Hover(context).altDisables(true); function edge(point, size) { @@ -120,7 +121,6 @@ iD.modes.DragNode = function(context) { connectAnnotation(d)); } else if (d.type === 'node' && d.id !== entity.id) { - // `entity` is last so it will survive and it's parent ways can be selected below. context.replace( iD.actions.Connect([d.id, entity.id]), connectAnnotation(d)); @@ -136,11 +136,13 @@ iD.modes.DragNode = function(context) { moveAnnotation(entity)); } - var parentWays = _.pluck(context.graph().parentWays(entity), 'id'); + var reselection = selection.filter(function(id) { + return context.graph().hasEntity(id); + }); - if (parentWays.length) { + if (reselection.length) { context.enter( - iD.modes.Select(context, parentWays) + iD.modes.Select(context, reselection) .suppressMenu(true)); } else { context.enter(iD.modes.Browse(context)); @@ -193,6 +195,12 @@ iD.modes.DragNode = function(context) { stopNudge(); }; + mode.selection = function(_) { + if (!arguments.length) return selection; + selection = _; + return mode; + }; + mode.behavior = behavior; return mode; diff --git a/js/id/modes/select.js b/js/id/modes/select.js index 3b7c47191..54841b646 100644 --- a/js/id/modes/select.js +++ b/js/id/modes/select.js @@ -10,7 +10,9 @@ iD.modes.Select = function(context, selection) { iD.behavior.Hover(context), iD.behavior.Select(context), iD.behavior.Lasso(context), - iD.modes.DragNode(context).behavior], + iD.modes.DragNode(context) + .selection(selection) + .behavior], inspector, radialMenu, newFeature = false, diff --git a/js/id/ui.js b/js/id/ui.js index 6ae548b13..6d78251a2 100644 --- a/js/id/ui.js +++ b/js/id/ui.js @@ -18,14 +18,17 @@ iD.ui = function(context) { .attr('class', 'col4') .call(iD.ui.Sidebar(context)); - var m = container.append('div') + var content = container.append('div') + .attr('id', 'content'); + + var bar = content.append('div') + .attr('id', 'bar') + .attr('class', 'fillD'); + + var m = content.append('div') .attr('id', 'map') .call(map); - var bar = m.append('div') - .attr('id', 'bar') - .attr('class','fillD'); - var limiter = bar.append('div') .attr('class', 'limiter'); @@ -45,12 +48,12 @@ iD.ui = function(context) { .attr('class', 'spinner') .call(iD.ui.Spinner(context)); - m.append('div') + content.append('div') .attr('class', 'attribution') .attr('tabindex', -1) .call(iD.ui.Attribution(context)); - m.append('div') + content.append('div') .style('display', 'none') .attr('class', 'help-wrap fillL col5 content'); @@ -79,7 +82,7 @@ iD.ui = function(context) { .attr('class', 'map-control geolocate-control') .call(iD.ui.Geolocate(map)); - var about = m.append('div') + var about = content.append('div') .attr('class','col12 about-block fillD'); about.append('div')