From d2d7b2fa836e1c225e5b235f5c66c04d6a4bc285 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFs=20Poujade?= <lois.poujade@tetras-libre.fr>
Date: Wed, 15 Jun 2022 17:22:14 +0200
Subject: [PATCH] Hide download button on notes/links

Closes #17
---
 capsule-prototype/js/PopupPanelWidget.js | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/capsule-prototype/js/PopupPanelWidget.js b/capsule-prototype/js/PopupPanelWidget.js
index 1e2424e..dcb81a7 100644
--- a/capsule-prototype/js/PopupPanelWidget.js
+++ b/capsule-prototype/js/PopupPanelWidget.js
@@ -916,14 +916,18 @@ PopupPanelWidget.prototype.createPopupContent = function (tag) {
             imageBoxDiv.append(displayOriginalImage);
         }
         popupLeftDiv.append(imageBoxDiv);
-        let downloadElement = $('<a>');
-        downloadElement
-          .html("Download File")
-          .addClass('popupLeftItem')
-          .attr('id', 'popupEditDownload')
-          .attr('href', fileDirectLink)
-          .attr('download', this.getMetadata('File->File Name'));
-        popupLeftDiv.append(downloadElement);
+
+        if (this.getMetadata('Rekall->Type') != "rekall/marker"
+          && this.getMetadata('Rekall->Type') != "rekall/link") {
+          let downloadElement = $('<a>');
+          downloadElement
+            .html("Download File")
+            .addClass('popupLeftItem')
+            .attr('id', 'popupEditDownload')
+            .attr('href', fileDirectLink)
+            .attr('download', this.getMetadata('File->File Name'));
+          popupLeftDiv.append(downloadElement);
+        }
 
         if (popupPanelWidget.canEdit()) {
             let deleteElement = $('<div>');
-- 
GitLab