From 2842beff334f273f50175edb766bd80e4d55410c Mon Sep 17 00:00:00 2001 From: Redume Date: Sat, 8 Oct 2022 21:38:29 +0300 Subject: [PATCH] if the picture is equal to the placeholder then the button is not available --- web/static/scripts/gallery.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/static/scripts/gallery.js b/web/static/scripts/gallery.js index 7fe1281..0fb9ea2 100644 --- a/web/static/scripts/gallery.js +++ b/web/static/scripts/gallery.js @@ -96,7 +96,13 @@ function wallpaper(data) { let title = document.querySelector(".w-modal-title"); let button = document.querySelector(".modal-footer"); - button.innerHTML = ``; + + if($(`img#${id}.card-img-top`).attr("src") !== "http://localhost:4662/static/image/placeholder.png") { + button.innerHTML = ``; + } else { + button.innerHTML = ``; + } + let setWallpaper = document.querySelector("#setWallpaper"); ids[id]['copyright'] = ids[id]['copyright'] === undefined ? "NASA" : ids[id]['copyright'];