Restore source switch for development

This commit is contained in:
John Firebaugh
2013-04-17 16:15:30 -07:00
parent a1d368e05c
commit a7a58d0775
2 changed files with 8 additions and 2 deletions

View File

@@ -211,8 +211,13 @@
iD.data.load(function() {
id = iD();
d3.select("#id-container")
.call(id.ui());
d3.select("#about").insert('li', '.user-list')
.attr('class', 'source-switch')
.call(iD.ui.SourceSwitch(id));
});
</script>
</body>

View File

@@ -5,10 +5,11 @@ iD.ui.SourceSwitch = function(context) {
if (context.history().hasChanges() &&
!window.confirm(t('source_switch.lose_changes'))) return;
var live = d3.select(this).classed('live');
var live = d3.select(this)
.classed('live');
context.connection()
.url(live ? 'http://api06.dev.openstreetmap.org' : 'http://www.openstreetmap.org');
.switch(live ? iD.data.keys[1] : iD.data.keys[0]);
context.map()
.flush();