From 25deb0a440504efa070e2d3ef886701b918e3c6e Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Thu, 23 May 2024 13:01:18 +0200 Subject: [PATCH] takes the value of the node not just the node --- .../js/lehre/lehrauftrag/acceptLehrauftrag.js | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/public/js/lehre/lehrauftrag/acceptLehrauftrag.js b/public/js/lehre/lehrauftrag/acceptLehrauftrag.js index 15c39db78..b1142ff34 100644 --- a/public/js/lehre/lehrauftrag/acceptLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/acceptLehrauftrag.js @@ -445,19 +445,6 @@ storniert_tooltip = function (e, cell, onRendered) { } }; -//recursive function that returns the tableuniqueid using the tableInstance -const findTableUniqueID = function (tableElement,count =0){ - if(count >=10){ - // after 10 iterations end the recursion - return null; - } - if(tableElement.attributes.tableuniqueid){ - return tableElement.attributes.tableuniqueid.value; - }else{ - findTableUniqueID(tableElement.parentElement, ++count); - } -} - $(function () { // Pruefen ob Promise unterstuetzt wird // Tabulator funktioniert nicht mit IE @@ -466,9 +453,9 @@ $(function () { $(document).on("tableInit", function (event, tabulatorInstance) { //passing the tabulator instance because the acceptLehrauftrag site loads two tabulator tables func_tableBuilt(tabulatorInstance); - - let uniqueTableID = findTableUniqueID(tabulatorInstance.element); - + + let uniqueTableID = tabulatorInstance.element.closest('[tableuniqueid]').attributes.tableuniqueid.value; + switch (uniqueTableID) { case "cancelledLehrauftrag": tabulatorInstance.on("renderComplete", () => {