diff --git a/modules/modes/save.js b/modules/modes/save.js index 9acc5ac0f7..e58326a810 100644 --- a/modules/modes/save.js +++ b/modules/modes/save.js @@ -16,6 +16,7 @@ export function modeSave(context) { var commit = uiCommit(context) .on('cancel', cancel); + var _conflictsUi; // uiConflicts var _location; var _success; @@ -65,7 +66,7 @@ export function modeSave(context) { .classed('active', true) .classed('inactive', false); - var ui = uiConflicts(context) + _conflictsUi = uiConflicts(context) .conflictList(conflicts) .origChanges(origChanges) .on('cancel', function() { @@ -86,7 +87,7 @@ export function modeSave(context) { uploader.processResolvedConflicts(changeset); }); - selection.call(ui); + selection.call(_conflictsUi); } @@ -199,6 +200,11 @@ export function modeSave(context) { } + mode.selectedIDs = function() { + return _conflictsUi ? _conflictsUi.shownEntityIds() : []; + }; + + mode.enter = function() { // Show sidebar context.ui().sidebar.expand(); diff --git a/modules/renderer/map.js b/modules/renderer/map.js index 44af8309ce..36e8e3d6ec 100644 --- a/modules/renderer/map.js +++ b/modules/renderer/map.js @@ -320,6 +320,7 @@ export function rendererMap(context) { var data; var set; var filter; + var applyFeatureLayerFilters = true; if (map.isInWideSelection()) { data = []; @@ -329,6 +330,8 @@ export function rendererMap(context) { }); fullRedraw = true; filter = utilFunctor(true); + // selected features should always be visible, so we can skip filtering + applyFeatureLayerFilters = false; } else if (difference) { var complete = difference.complete(map.extent()); @@ -356,7 +359,11 @@ export function rendererMap(context) { } } - data = features.filter(data, graph); + if (applyFeatureLayerFilters) { + data = features.filter(data, graph); + } else { + context.features().resetStats(); + } if (mode && mode.id === 'select') { // update selected vertices - the user might have just double-clicked a way, @@ -1022,7 +1029,7 @@ export function rendererMap(context) { map.isInWideSelection = function() { - return !map.withinEditableZoom() && context.mode() && context.mode().id === 'select'; + return !map.withinEditableZoom() && context.selectedIDs().length; }; diff --git a/modules/ui/conflicts.js b/modules/ui/conflicts.js index 2a91c357e5..1cd2134cfb 100644 --- a/modules/ui/conflicts.js +++ b/modules/ui/conflicts.js @@ -25,6 +25,7 @@ export function uiConflicts(context) { var keybinding = utilKeybinding('conflicts'); var _origChanges; var _conflictList; + var _shownConflictIndex; function keybindingOn() { @@ -145,6 +146,7 @@ export function uiConflicts(context) { function showConflict(selection, index) { index = utilWrap(index, _conflictList.length); + _shownConflictIndex = index; var parent = d3_select(selection.node().parentNode); @@ -343,5 +345,13 @@ export function uiConflicts(context) { }; + conflicts.shownEntityIds = function() { + if (_conflictList && typeof _shownConflictIndex === 'number') { + return [_conflictList[_shownConflictIndex].id]; + } + return []; + }; + + return utilRebind(conflicts, dispatch, 'on'); }