From 035928420ce7df4da6510c2407916cb98fae7244 Mon Sep 17 00:00:00 2001 From: Daniel Hornung <d.hornung@indiscale.com> Date: Tue, 18 Jan 2022 14:42:38 +0100 Subject: [PATCH] FIX: Show ID also for elements which come later. --- src/core/css/webcaosdb.css | 1 + src/core/js/webcaosdb.js | 12 +++++++++--- src/core/xsl/entity.xsl | 6 +++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/core/css/webcaosdb.css b/src/core/css/webcaosdb.css index 82de9842..8fe10a15 100644 --- a/src/core/css/webcaosdb.css +++ b/src/core/css/webcaosdb.css @@ -285,6 +285,7 @@ h5 { .caosdb-label-id { margin-right: 0.3em; + display: none; } .caosdb-label-name { diff --git a/src/core/js/webcaosdb.js b/src/core/js/webcaosdb.js index 75bb2732..6d8971c0 100644 --- a/src/core/js/webcaosdb.js +++ b/src/core/js/webcaosdb.js @@ -4,8 +4,10 @@ * * Copyright (C) 2018 Research Group Biomedical Physics, * Max-Planck-Institute for Dynamics and Self-Organization Göttingen - * Copyright (C) 2019 IndiScale GmbH (info@indiscale.com) - * Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com) + * Copyright (C) 2022 IndiScale GmbH <info@indiscale.com> + * Copyright (C) 2019 Timm Fitschen <t.fitschen@indiscale.com> + * Copyright (C) 2022 Florian Spreckelsen <f.spreckelsen@indiscale.com> + * Copyright (C) 2022 Daniel Hornung <d.hornung@indiscale.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -1961,7 +1963,11 @@ function initOnDocumentReady() { } if ("${BUILD_MODULE_SHOW_ID_IN_LABEL}" == "ENABLED") { - $('.caosdb-label-id').toggleClass('d-none'); + // Remove the "display: none;" rule from the caosdb-label-id class + [...document.styleSheets] + .map(s => {return [...s.cssRules].find(x=> x.selectorText=='.caosdb-label-id')}) + .filter(Boolean) + .forEach( rule => rule.style.removeProperty("display")); } } diff --git a/src/core/xsl/entity.xsl b/src/core/xsl/entity.xsl index 0c7b90d0..ab797936 100644 --- a/src/core/xsl/entity.xsl +++ b/src/core/xsl/entity.xsl @@ -5,6 +5,10 @@ * * Copyright (C) 2018 Research Group Biomedical Physics, * Max-Planck-Institute for Dynamics and Self-Organization Göttingen + * Copyright (C) 2022 Indiscale GmbH <info@indiscale.com> + * Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com> + * Copyright (C) 2022 Florian Spreckelsen <f.spreckelsen@indiscale.com> + * Copyright (C) 2022 Daniel Hornung <d.hornung@indiscale.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -150,7 +154,7 @@ <xsl:attribute name="href"> <xsl:value-of select="concat($entitypath, @id)"/> </xsl:attribute> - <span class="caosdb-label-id d-none"><xsl:value-of select="@id"/></span> + <span class="caosdb-label-id"><xsl:value-of select="@id"/></span> <span class="caosdb-label-name"> <xsl:value-of select="@name"/> </span> -- GitLab