Skip to content

Commit

Permalink
added button to clear avatar, reverting it to default
Browse files Browse the repository at this point in the history
  • Loading branch information
albogdano committed Feb 7, 2020
1 parent b507334 commit 965bb0a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/resources/static/scripts/scoold.js
Expand Up @@ -493,6 +493,15 @@ $(function () {
return false;
});

$("#clear-avatar-btn").click(function () {
var defaultAvatar = window.location.origin + "/people/avatar";
$("img.profile-pic").attr("src", defaultAvatar);
pictureUrlInput.val(defaultAvatar);
$.post($(this).closest("form").attr("action"), {picture: defaultAvatar});
return false;
});


/****************************************************
* MODAL DIALOGS
****************************************************/
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/templates/profile.vm
Expand Up @@ -41,6 +41,7 @@
#set($secondaryPicture = $!gravatarPicture)
#end
<input type="hidden" value="$!secondaryPicture">
<a href="#" id="clear-avatar-btn">$!lang.get('clear')</a>
</div>
<div class="switch right">
<label>
Expand Down

0 comments on commit 965bb0a

Please sign in to comment.