proper indentation.

This commit is contained in:
Saman Bemel-Benrud
2012-12-11 11:16:32 -05:00
parent f022d9d965
commit 77b142af6a
2 changed files with 64 additions and 63 deletions

View File

@@ -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')

View File

@@ -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("<em>Layers</em>")
.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("<div class='select-box'></div>")
.call(bootstrap.tooltip().placement('top'))
.append('div')
.attr('class', 'opacity')
.style('opacity', function(d) {
return d.level;
});
.attr('class', 'opacity-options-wrapper fillL2')
.html("<em>Layers</em>")
.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("<div class='select-box'></div>")
.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');