mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-24 21:10:21 +01:00
Merge pull request #5631 from wonga00/continuous_validation
listening to user generated history changes for validation
This commit is contained in:
@@ -443,12 +443,20 @@ export function coreContext() {
|
||||
}
|
||||
|
||||
history = coreHistory(context);
|
||||
|
||||
context.graph = history.graph;
|
||||
context.changes = history.changes;
|
||||
context.intersects = history.intersects;
|
||||
|
||||
issueManager = IssueManager(context);
|
||||
|
||||
var debouncedValidate = _debounce(issueManager.validate, 1000);
|
||||
history.on('change', function(difference) {
|
||||
if (difference) {
|
||||
debouncedValidate();
|
||||
}
|
||||
});
|
||||
|
||||
// Debounce save, since it's a synchronous localStorage write,
|
||||
// and history changes can happen frequently (e.g. when dragging).
|
||||
context.debouncedSave = _debounce(context.save, 350);
|
||||
|
||||
@@ -20,6 +20,8 @@ export function uiIssues(context) {
|
||||
var _issuesList = d3_select(null);
|
||||
var _shown = false;
|
||||
|
||||
context.issueManager().on('reload', update);
|
||||
|
||||
function renderIssuesOptions(selection) {
|
||||
var container = selection.selectAll('.issues-options-container')
|
||||
.data([0]);
|
||||
|
||||
@@ -23,7 +23,6 @@ export function IssueManager(context) {
|
||||
};
|
||||
|
||||
self.getIssues = function() {
|
||||
self.validate();
|
||||
return issues;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user