From f98cee40a7a0f34ef1b2a43e5c083fb2ca62d030 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 12 Feb 2013 20:46:54 -0800 Subject: [PATCH] Extract iD.ui.Attribution --- index.html | 1 + js/id/ui.js | 12 +++--------- js/id/ui/attribution.js | 10 ++++++++++ 3 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 js/id/ui/attribution.js diff --git a/index.html b/index.html index e79c178e4..6e8661145 100644 --- a/index.html +++ b/index.html @@ -57,6 +57,7 @@ + diff --git a/js/id/ui.js b/js/id/ui.js index 3379ef4f1..328d46b45 100644 --- a/js/id/ui.js +++ b/js/id/ui.js @@ -90,15 +90,9 @@ iD.ui = function(context) { .attr('href', 'http://github.com/systemed/iD/issues') .text(t('report_a_bug')); - var imagery = linkList.append('li') - .attr('id', 'attribution'); - - imagery.append('span') - .text('imagery'); - - imagery - .append('span') - .attr('class', 'provided-by'); + linkList.append('li') + .attr('id', 'attribution') + .call(iD.ui.Attribution(context)); linkList.append('li') .attr('class', 'source-switch') diff --git a/js/id/ui/attribution.js b/js/id/ui/attribution.js new file mode 100644 index 000000000..282833e7e --- /dev/null +++ b/js/id/ui/attribution.js @@ -0,0 +1,10 @@ +iD.ui.Attribution = function(context) { + return function(selection) { + selection.append('span') + .text('imagery'); + + selection + .append('span') + .attr('class', 'provided-by'); + } +};