Skip to content
Snippets Groups Projects
Commit 5b3b7c5c authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

FIX: Problems with retrieving heading attributes with active preview.

parent 14efe71e
No related branches found
No related tags found
2 merge requests!90F citation cff,!33Draft: F fix get parents
......@@ -404,12 +404,13 @@ function getIDfromHREF(el) {
/**
* Return an entity heading attribute from an element.
*
* @param element The element holding the entity.
* @return The value of the entity heading attribute or undefined if it is not present.
*/
function getEntityHeadingAttribute(element, attribute_name) {
var res = element.getElementsByClassName("caosdb-entity-heading-attr");
var res = findElementByConditions(element, x => x.classList.contains("caosdb-entity-heading-attr"),
x => x.classList.contains("caosdb-preview-container"));
for (var i = 0; i < res.length; i++) {
var subres = res[i].getElementsByClassName("caosdb-entity-heading-attr-name");
if (subres.length != 1) {
......@@ -444,7 +445,6 @@ function getEntityDescription(element) {
* @return A list of objects with name and id of the parents.
*/
function getParents(element) {
// var res = element.getElementsByClassName("caosdb-parent-name");
var res = findElementByConditions(element, x => x.classList.contains("caosdb-parent-name"),
x => x.classList.contains("caosdb-preview-container"));
var list = [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment