mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-16 05:49:16 +02:00
Namespace selectors to iD-owned elements
This commit is contained in:
@@ -9,7 +9,7 @@ iD.behavior.DragMidpoint = function(context) {
|
||||
|
||||
context.perform(iD.actions.AddMidpoint(d, node));
|
||||
|
||||
var vertex = d3.selectAll('.vertex')
|
||||
var vertex = context.surface().selectAll('.vertex')
|
||||
.filter(function(data) { return data.id === node.id; });
|
||||
|
||||
behavior.target(vertex.node(), vertex.datum());
|
||||
|
||||
@@ -49,6 +49,7 @@ iD.Map = function(context) {
|
||||
|
||||
map.size(selection.size());
|
||||
map.surface = surface;
|
||||
map.tilesurface = tilegroup;
|
||||
|
||||
supersurface
|
||||
.call(tail);
|
||||
|
||||
+1
-2
@@ -226,7 +226,7 @@ iD.svg.Labels = function(projection) {
|
||||
d3.select(surface.node().parentNode)
|
||||
.on('mousemove.hidelabels', hideOnMouseover);
|
||||
|
||||
var hidePoints = !d3.select('.node.point').node();
|
||||
var hidePoints = !surface.select('.node.point').node();
|
||||
|
||||
var labelable = [], i, k, entity;
|
||||
for (i = 0; i < label_stack.length; i++) labelable.push([]);
|
||||
@@ -254,7 +254,6 @@ iD.svg.Labels = function(projection) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var positions = {
|
||||
point: [],
|
||||
line: [],
|
||||
|
||||
+5
-4
@@ -35,11 +35,12 @@ iD.ui.commit = function(context) {
|
||||
|
||||
// Comment Box
|
||||
var comment_section = body.append('div').attr('class','modal-section fillD');
|
||||
comment_section.append('textarea')
|
||||
var commentField = comment_section.append('textarea')
|
||||
.attr('class', 'changeset-comment')
|
||||
.attr('placeholder', 'Brief Description of your contributions')
|
||||
.property('value', context.storage('comment') || '')
|
||||
.node().select();
|
||||
.property('value', context.storage('comment') || '');
|
||||
|
||||
commentField.node().select();
|
||||
|
||||
var commit_info =
|
||||
comment_section
|
||||
@@ -73,7 +74,7 @@ iD.ui.commit = function(context) {
|
||||
.append('button')
|
||||
.attr('class', 'save action col6 button')
|
||||
.on('click.save', function() {
|
||||
var comment = d3.select('textarea.changeset-comment').node().value;
|
||||
var comment = commentField.node().value;
|
||||
localStorage.comment = comment;
|
||||
event.save({
|
||||
comment: comment
|
||||
|
||||
@@ -61,9 +61,10 @@ iD.ui.layerswitcher = function(context) {
|
||||
|
||||
opa.append('h4').text(t('layerswitcher.layers'));
|
||||
|
||||
opa.append('ul')
|
||||
.attr('class', 'opacity-options')
|
||||
.selectAll('div.opacity')
|
||||
var opacityList = opa.append('ul')
|
||||
.attr('class', 'opacity-options');
|
||||
|
||||
opacityList.selectAll('div.opacity')
|
||||
.data(opacities)
|
||||
.enter()
|
||||
.append('li')
|
||||
@@ -71,11 +72,11 @@ iD.ui.layerswitcher = function(context) {
|
||||
return t('layerswitcher.percent_brightness', { opacity: (d * 100) });
|
||||
})
|
||||
.on('click.set-opacity', function(d) {
|
||||
d3.select('#tile-g')
|
||||
context.map().tilesurface
|
||||
.transition()
|
||||
.style('opacity', d)
|
||||
.attr('data-opacity', d);
|
||||
d3.selectAll('.opacity-options li')
|
||||
opacityList.selectAll('li')
|
||||
.classed('selected', false);
|
||||
d3.select(this)
|
||||
.classed('selected', true);
|
||||
|
||||
Reference in New Issue
Block a user