From 2b6139de2bc980d76e49f34f4201dabbd33a814b Mon Sep 17 00:00:00 2001 From: robyngit Date: Wed, 18 Sep 2024 17:11:39 -0400 Subject: [PATCH] Show icon & name in Data Object modal view Issue #1758 --- src/js/views/ViewObjectButtonView.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/js/views/ViewObjectButtonView.js b/src/js/views/ViewObjectButtonView.js index 8d8d38afa..c57ba5621 100644 --- a/src/js/views/ViewObjectButtonView.js +++ b/src/js/views/ViewObjectButtonView.js @@ -16,6 +16,7 @@ define(["jquery", "backbone", "views/DataObjectView"], ( closeButton: ["close"], body: ["modal-body"], footer: ["modal-footer"], + titleIcon: ["icon", "icon-on-left"], }; const BUTTON_TEXT = "View"; const CLOSE_BUTTON_TEXT = "Close"; @@ -54,12 +55,12 @@ define(["jquery", "backbone", "views/DataObjectView"], ( * @param {string} options.title - The title of the modal * @returns {string} The HTML for the modal */ - modalTemplate({ title = "Data" } = {}) { + modalTemplate({ title = "Data", icon = "file-text" } = {}) { const id = `modal-${this.model.cid}`; return `
-

${title}

+

${title}

loading...

@@ -108,7 +109,9 @@ define(["jquery", "backbone", "views/DataObjectView"], ( */ renderModal() { const modalHTML = this.modalTemplate({ - title: this.model.get("title") || "Data", + title: + this.model.get("title") || this.model.get("fileName") || "Data", + icon: "table", }); const modal = $(modalHTML).modal(); const modalBody = modal.find(`.${CLASS_NAMES.body.join(".")}`);