From a7a58d07758e79df6b7d342c8eddf5b63ea5c87c Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 17 Apr 2013 16:15:30 -0700 Subject: [PATCH] Restore source switch for development --- index.html | 5 +++++ js/id/ui/source_switch.js | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 8f9c1444d..020d806bd 100644 --- a/index.html +++ b/index.html @@ -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)); }); diff --git a/js/id/ui/source_switch.js b/js/id/ui/source_switch.js index 8b9e2bd20..895a11a42 100644 --- a/js/id/ui/source_switch.js +++ b/js/id/ui/source_switch.js @@ -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();