mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-22 00:07:03 +02:00
Move flush to context
This commit is contained in:
@@ -79,6 +79,13 @@ window.iD = function () {
|
||||
context.changes = history.changes;
|
||||
context.intersects = history.intersects;
|
||||
|
||||
context.flush = function() {
|
||||
history.reset();
|
||||
connection.flush();
|
||||
map.redraw();
|
||||
return context;
|
||||
};
|
||||
|
||||
/* Graph */
|
||||
context.hasEntity = function(id) {
|
||||
return history.graph().hasEntity(id);
|
||||
|
||||
@@ -404,12 +404,6 @@ iD.Map = function(context) {
|
||||
return newZoom;
|
||||
};
|
||||
|
||||
map.flush = function() {
|
||||
context.connection().flush();
|
||||
context.history().reset();
|
||||
return map;
|
||||
};
|
||||
|
||||
map.editable = function() {
|
||||
return map.zoom() >= 16;
|
||||
};
|
||||
|
||||
+1
-2
@@ -54,8 +54,7 @@ iD.ui.Save = function(context) {
|
||||
.append('p')
|
||||
.text(err.responseText);
|
||||
} else {
|
||||
history.reset();
|
||||
map.flush().redraw();
|
||||
context.flush();
|
||||
success(e, changeset_id);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -13,8 +13,7 @@ iD.ui.SourceSwitch = function(context) {
|
||||
context.connection()
|
||||
.switch(live ? keys[1] : keys[0]);
|
||||
|
||||
context.map()
|
||||
.flush();
|
||||
context.flush();
|
||||
|
||||
d3.select(this)
|
||||
.text(live ? t('source_switch.dev') : t('source_switch.live'))
|
||||
|
||||
Reference in New Issue
Block a user