Move flush to context

This commit is contained in:
John Firebaugh
2013-05-17 16:51:01 -07:00
parent 8e05ed271d
commit 5c9c865f12
4 changed files with 9 additions and 10 deletions
+7
View File
@@ -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);
-6
View File
@@ -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
View File
@@ -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);
}
});
+1 -2
View File
@@ -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'))