mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-31 04:09:33 +02:00
Merge branch 'master' into validation
# Conflicts: # data/core.yaml # dist/locales/en.json # modules/ui/commit_warnings.js # modules/ui/entity_editor.js # modules/util/index.js # modules/util/util.js # modules/validations/index.js # modules/validations/many_deletions.js # modules/validations/missing_tag.js
This commit is contained in:
+10
-1
@@ -146,7 +146,9 @@ export function coreContext() {
|
||||
this.loadEntity(entityID, function(err, result) {
|
||||
if (err) return;
|
||||
var entity = _find(result.data, function(e) { return e.id === entityID; });
|
||||
if (entity) { map.zoomTo(entity); }
|
||||
if (entity) {
|
||||
map.zoomTo(entity);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -264,6 +266,13 @@ export function coreContext() {
|
||||
return context;
|
||||
};
|
||||
|
||||
var _selectedErrorID;
|
||||
context.selectedErrorID = function(errorID) {
|
||||
if (!arguments.length) return _selectedErrorID;
|
||||
_selectedErrorID = errorID;
|
||||
return context;
|
||||
};
|
||||
|
||||
|
||||
/* Behaviors */
|
||||
context.install = function(behavior) {
|
||||
|
||||
+15
-6
@@ -52,9 +52,6 @@ export function coreHistory(context) {
|
||||
annotation = actions.pop();
|
||||
}
|
||||
|
||||
_stack[_index].transform = context.projection.transform();
|
||||
_stack[_index].selectedIDs = context.selectedIDs();
|
||||
|
||||
var graph = _stack[_index].graph;
|
||||
for (var i = 0; i < actions.length; i++) {
|
||||
graph = actions[i](graph, t);
|
||||
@@ -63,7 +60,9 @@ export function coreHistory(context) {
|
||||
return {
|
||||
graph: graph,
|
||||
annotation: annotation,
|
||||
imageryUsed: _imageryUsed
|
||||
imageryUsed: _imageryUsed,
|
||||
transform: context.projection.transform(),
|
||||
selectedIDs: context.selectedIDs()
|
||||
};
|
||||
}
|
||||
|
||||
@@ -410,7 +409,8 @@ export function coreHistory(context) {
|
||||
var base = _stack[0];
|
||||
|
||||
var s = _stack.map(function(i) {
|
||||
var modified = [], deleted = [];
|
||||
var modified = [];
|
||||
var deleted = [];
|
||||
|
||||
_forEach(i.graph.entities, function(entity, id) {
|
||||
if (entity) {
|
||||
@@ -440,6 +440,8 @@ export function coreHistory(context) {
|
||||
if (deleted.length) x.deleted = deleted;
|
||||
if (i.imageryUsed) x.imageryUsed = i.imageryUsed;
|
||||
if (i.annotation) x.annotation = i.annotation;
|
||||
if (i.transform) x.transform = i.transform;
|
||||
if (i.selectedIDs) x.selectedIDs = i.selectedIDs;
|
||||
|
||||
return x;
|
||||
});
|
||||
@@ -537,7 +539,9 @@ export function coreHistory(context) {
|
||||
return {
|
||||
graph: coreGraph(_stack[0].graph).load(entities),
|
||||
annotation: d.annotation,
|
||||
imageryUsed: d.imageryUsed
|
||||
imageryUsed: d.imageryUsed,
|
||||
transform: d.transform,
|
||||
selectedIDs: d.selectedIDs
|
||||
};
|
||||
});
|
||||
|
||||
@@ -555,6 +559,11 @@ export function coreHistory(context) {
|
||||
});
|
||||
}
|
||||
|
||||
var transform = _stack[_index].transform;
|
||||
if (transform) {
|
||||
context.map().transformEase(transform, 0); // 0 = immediate, no easing
|
||||
}
|
||||
|
||||
if (loadComplete) {
|
||||
dispatch.call('change');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user