Hide user panel when it would just be showing login. Fixes #209

This commit is contained in:
Tom MacWright
2012-12-07 12:02:15 -05:00
parent bb6c0489a0
commit 0e00998bc4
+2 -6
View File
@@ -5,6 +5,7 @@ iD.userpanel = function(connection) {
function update() {
selection.html('');
if (connection.authenticated()) {
selection.style('display', 'block');
connection.userDetails(function(user_details) {
selection.append('span')
.text('signed in as ')
@@ -24,12 +25,7 @@ iD.userpanel = function(connection) {
});
});
} else {
selection
.append('a')
.attr('class', 'login')
.attr('href', '#')
.text('login')
.on('click', event.login);
selection.html('').style('display', 'none');
}
}
connection.on('auth', update);