Purge a few more uses of d3.select, refs #595

This commit is contained in:
Tom MacWright
2013-02-04 12:32:14 -05:00
parent a7d7a2e3da
commit 8d90fb777b
3 changed files with 10 additions and 7 deletions
+5 -3
View File
@@ -140,8 +140,10 @@ iD.ui = function (context) {
var about = container.append('div')
.attr('class','col12 about-block fillD pad1');
about.append('div')
.attr('class', 'user-container')
var userContainer = about.append('div')
.attr('class', 'user-container');
userContainer
.append('div')
.attr('class', 'hello');
@@ -243,7 +245,7 @@ iD.ui = function (context) {
map.centerZoom([-77.02271, 38.90085], 20);
}
d3.select('.user-container').call(iD.ui.userpanel(connection)
userContainer.call(iD.ui.userpanel(connection)
.on('logout.editor', connection.logout)
.on('login.editor', connection.authenticate));
+3 -4
View File
@@ -38,9 +38,8 @@ iD.ui.geocoder = function() {
function setVisible(show) {
button.classed('active', show);
gcForm.classed('hide', !show);
var input_node = d3.select('.map-overlay input').node();
if (show) input_node.focus();
else input_node.blur();
if (show) inputNode.node().focus();
else inputNode.node().blur();
}
var button = selection.append('button')
@@ -51,7 +50,7 @@ iD.ui.geocoder = function() {
var gcForm = selection.append('form');
gcForm.attr('class','content fillD map-overlay hide')
var inputNode = gcForm.attr('class','content fillD map-overlay hide')
.append('input')
.attr({ type: 'text', placeholder: t('geocoder.find_a_place') })
.on('keydown', keydown);
+2
View File
@@ -14,6 +14,7 @@ iD.ui.save = function(context) {
.on('click', function() {
function commit(e) {
d3.select('.shaded').remove();
var l = iD.ui.loading(t('uploading_changes'), true);
connection.putChangeset(history.changes(), e.comment, history.imagery_used(), function(err, changeset_id) {
@@ -40,6 +41,7 @@ iD.ui.save = function(context) {
}));
}
});
}
if (history.hasChanges()) {