From 77b142af6a10e91b565501814eeb8a6cdeed1bed Mon Sep 17 00:00:00 2001 From: Saman Bemel-Benrud Date: Tue, 11 Dec 2012 11:16:32 -0500 Subject: [PATCH] proper indentation. --- js/id/id.js | 2 +- js/id/ui/layerswitcher.js | 125 +++++++++++++++++++------------------- 2 files changed, 64 insertions(+), 63 deletions(-) diff --git a/js/id/id.js b/js/id/id.js index 47e2e3d12..2970588ad 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -70,7 +70,7 @@ window.iD = function(container) { this.append('div') .attr('class', 'user') .append('div') - .attr('class', 'hello'); + .attr('class', 'hello'); bar.append('button') .attr('class', 'save action wide') diff --git a/js/id/ui/layerswitcher.js b/js/id/ui/layerswitcher.js index bec3db02c..509a3fb51 100644 --- a/js/id/ui/layerswitcher.js +++ b/js/id/ui/layerswitcher.js @@ -27,55 +27,56 @@ iD.layerswitcher = function(map) { function layerswitcher(selection) { selection .append('button') - .attr('class', 'narrow') - .text('Layers') - .on('click', function() { - d3.select(this) - .classed('active', function() { - if ( !content.classed('hide')) { - return false; - } else { - return true; - } - }) - content.classed('hide', function() { - return !content.classed('hide'); + .attr('class', 'narrow') + .text('Layers') + .on('click', function() { + d3.select(this) + .classed('active', function() { + if ( !content.classed('hide')) { + return false; + } else { + return true; + } + }) + content.classed('hide', function() { + return !content.classed('hide'); + }); }); - }); var content = selection .append('div').attr('class', 'content map-overlay hide'); opa = content .append('div') - .attr('class', 'opacity-options-wrapper fillL2') - .html("Layers") - .append('ul') - .attr('class', 'opacity-options') - .selectAll('div.opacity') - .data(opacities) - .enter() - .append('li') - .attr('data-original-title', function(d) { - return d.label + " opacity"; - }) - .on('click', function(d) { - d3.select('#tile-g') - .transition() - .style('opacity', d.level) - .attr('data-opacity', d.level); - d3.selectAll('.opacity-options li') - .classed('selected', false) - d3.select(this) - .classed('selected', true) - }) - .html("
") - .call(bootstrap.tooltip().placement('top')) - .append('div') - .attr('class', 'opacity') - .style('opacity', function(d) { - return d.level; - }); + .attr('class', 'opacity-options-wrapper fillL2') + .html("Layers") + .append('ul') + .attr('class', 'opacity-options') + .selectAll('div.opacity') + .data(opacities) + .enter() + .append('li') + .attr('data-original-title', function(d) { + return d.label + " opacity"; + }) + .on('click', function(d) { + d3.select('#tile-g') + .transition() + .style('opacity', d.level) + .attr('data-opacity', d.level); + d3.selectAll('.opacity-options li') + .classed('selected', false) + d3.select(this) + .classed('selected', true) + }) + .html("
") + .call(bootstrap.tooltip().placement('top')) + .append('div') + .attr('class', 'opacity') + .style('opacity', function(d) { + return d.level; + }); + // Make sure there is an active selection by default d3.select('.opacity-options li').classed('selected', true) @@ -88,31 +89,31 @@ iD.layerswitcher = function(map) { content .append('ul') - .attr('class', 'toggle-list') + .attr('class', 'toggle-list') .selectAll('a.layer') .data(sources) .enter() .append('li') - .append('a') - .attr('data-original-title', function(d) { - return d.description; - }) - .attr('href', '#') - .attr('class', 'layer') - .text(function(d) { - return d.name; - }) - .call(bootstrap.tooltip().placement('right')) - .on('click', function(d) { - d3.event.preventDefault(); - map.background.source(d.source); - map.redraw(); - selectLayer(d); - }) - .insert('span') - .attr('class','icon toggle'); - selectLayer(map.background.source()); + .append('a') + .attr('data-original-title', function(d) { + return d.description; + }) + .attr('href', '#') + .attr('class', 'layer') + .text(function(d) { + return d.name; + }) + .call(bootstrap.tooltip().placement('right')) + .on('click', function(d) { + d3.event.preventDefault(); + map.background.source(d.source); + map.redraw(); + selectLayer(d); + }) + .insert('span') + .attr('class','icon toggle'); + selectLayer(map.background.source()); } return d3.rebind(layerswitcher, event, 'on');