fix #1740 better UI for edit btn when the image is deleted

This commit is contained in:
Matthieu Leproux
2022-10-03 14:43:17 +02:00
parent 3377cb5d8c
commit 38105aff23
5 changed files with 20 additions and 1 deletions
+12 -1
View File
@@ -301,7 +301,18 @@ function lineConstructor(line, id, imageDisplay) {
fillHistoryResult(current_param);
});
}
newLine.find(".edit-img").attr("href", line.EDIT_IMAGE)
if (line.EDIT_IMAGE != "") {
newLine.find(".edit-img").attr("href", line.EDIT_IMAGE);
} else {
newLine.find(".edit-img")
.attr("href", "#")
.addClass("notClickable tiptip")
.attr('title', str_no_longer_exist_photo)
.on("click", (e) => {
e.preventDefault();
});
}
switch (line.SECTION) {
case "tags":
@@ -41,6 +41,7 @@ const str_favorites = "{'Your favorites'|translate}";
const str_recent_cats = "{'Recent albums'|translate}";
const str_recent_pics = "{'Recent photos'|translate}";
const str_memories = "{'Memories'|translate}";
const str_no_longer_exist_photo = "{'This photo no longer exists'|@translate}";
const unit_MB = "{"%s MB"|@translate}";
const str_guest = '{'guest'|@translate}';
const guest_id = {$guest_id};
@@ -276,6 +277,10 @@ jQuery(document).ready( function() {
<style>
.notClickable {
opacity: 0.5;
}
.container {
padding: 0 20px;
}