forked from MapComplete/MapComplete
Add logout button, fix # 23
This commit is contained in:
parent
b1775d8184
commit
118a60c805
4 changed files with 113 additions and 7 deletions
|
@ -22,15 +22,20 @@ export class UserBadge extends UIElement {
|
|||
this._userDetails = userDetails;
|
||||
this._pendingChanges = pendingChanges;
|
||||
this._basemap = basemap;
|
||||
|
||||
this._logout = new FixedUiElement("<img src='assets/logout.svg' alt='logout'>")
|
||||
.onClick(() => {userDetails.data.osmConnection.LogOut();});
|
||||
|
||||
this._logout = new FixedUiElement("<img src='assets/logout.svg' class='small-userbadge-icon' alt='logout'>")
|
||||
.onClick(() => {
|
||||
userDetails.data.osmConnection.LogOut();
|
||||
});
|
||||
|
||||
userDetails.addCallback(function () {
|
||||
const profilePic = document.getElementById("profile-pic");
|
||||
profilePic.onload = function () {
|
||||
profilePic.style.opacity = "1"
|
||||
};
|
||||
if (profilePic) {
|
||||
|
||||
profilePic.onload = function () {
|
||||
profilePic.style.opacity = "1"
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -92,6 +97,7 @@ export class UserBadge extends UIElement {
|
|||
"<span id='csCount'> " +
|
||||
" <a href='https://www.openstreetmap.org/user/" + user.name + "/history' target='_blank'><img class='small-userbadge-icon' src='./assets/star.svg' alt='star'/> " + user.csCount +
|
||||
"</a></span> " +
|
||||
this._logout.Render() +
|
||||
this._pendingChanges.Render() +
|
||||
"</p>" +
|
||||
|
||||
|
@ -112,6 +118,7 @@ export class UserBadge extends UIElement {
|
|||
|
||||
}
|
||||
}
|
||||
this._logout.Update();
|
||||
}
|
||||
|
||||
Activate() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue