Profile pictures are clickable
This commit is contained in:
parent
c205219d47
commit
2851d7764c
5 changed files with 11 additions and 11 deletions
|
|
@ -131,13 +131,9 @@ function displayNote(note, alias, user_note_field = null, profile_pic_field = nu
|
|||
$("#" + user_note_field).text(alias + (note.balance == null ? "" : (" :\n" + pretty_money(note.balance))));
|
||||
if (profile_pic_field != null) {
|
||||
$("#" + profile_pic_field).attr('src', img);
|
||||
$("#" + profile_pic_field).click(function () {
|
||||
if (note.resourcetype === "NoteUser") {
|
||||
document.location.href = "/accounts/user/" + note.user;
|
||||
} else if (note.resourcetype === "NoteClub") {
|
||||
document.location.href = "/accounts/club/" + note.club;
|
||||
}
|
||||
});
|
||||
$("#" + profile_pic_field + "_link").attr('href', note.resourcetype === "NoteUser" ?
|
||||
"/accounts/user/" + note.user : note.resourcetype === "NoteClub" ?
|
||||
"/accounts/club/" + note.club : "#");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,6 +145,7 @@ function reset() {
|
|||
$("#consos_list").html("");
|
||||
$("#user_note").text("");
|
||||
$("#profile_pic").attr("src", "/media/pic/default.png");
|
||||
$("#profile_pic_link").attr("href", "#");
|
||||
refreshHistory();
|
||||
refreshBalance();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ function reset(refresh=true) {
|
|||
$("#bank").val("");
|
||||
$("#user_note").val("");
|
||||
$("#profile_pic").attr("src", "/media/pic/default.png");
|
||||
$("#profile_pic_link").attr("href", "#");
|
||||
if (refresh) {
|
||||
refreshBalance();
|
||||
refreshHistory();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue