Added JS confirmation for photo deletion.
This commit is contained in:
parent
d470d49c48
commit
71f1b8001b
2 changed files with 18 additions and 1 deletions
14
webapp/web/js/imageUpload/confirmPhotoDeletion.js
Normal file
14
webapp/web/js/imageUpload/confirmPhotoDeletion.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
function delete_photo(passUrl) {
|
||||
|
||||
var delete_photo_answer = confirm ("Are you sure you want to delete your photo?");
|
||||
|
||||
if (delete_photo_answer){
|
||||
window.open(passUrl);
|
||||
}
|
||||
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,10 @@
|
|||
|
||||
<#-- Upload a replacement main image for an Individual. -->
|
||||
|
||||
|
||||
|
||||
${scripts.add("/js/imageUpload/validateUpload.js")}
|
||||
${scripts.add("/js/imageUpload/confirmPhotoDeletion.js")}
|
||||
|
||||
|
||||
${stylesheets.addFromTheme("/uploadImages.css")}
|
||||
|
@ -16,7 +19,7 @@ ${stylesheets.addFromTheme("/uploadImages.css")}
|
|||
<div id="photoUploadDefaultImageContainer">
|
||||
<h6>Current Photo</h6>
|
||||
<img src="${thumbnailUrl}" width="115" height="115" /> <br />
|
||||
<a href="${deleteUrl}">Delete photo</a></div>
|
||||
<a href='javascript:delete_photo("${deleteUrl}");'>Delete photo</a></div>
|
||||
<div id="photoUploadForm">
|
||||
<form action="${formAction}" enctype="multipart/form-data" method="post" onSubmit="return validate_upload_file(this)">
|
||||
<label>Replace Photo <span> (JPEG, GIF or PNG. Max Size: 50 MB)</span></label>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue