mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-14 21:28:11 +02:00
Enable low-zoom display of focused feature when resolving conflicts (close #7330)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user