Merge branch 'bug-67033/Stv_Verband_Auswahl_springt'

This commit is contained in:
Harald Bamberger
2025-09-17 14:08:37 +02:00
2 changed files with 19 additions and 0 deletions
@@ -188,6 +188,7 @@ class Verband extends FHCAPI_Controller
array_unshift($list, [
'name' => 'PreStudent',
'link' => $link . 'prestudent',
'stg_kz' => (int)$studiengang_kz,
'children' => $this->getStdSem($link . 'prestudent/', $studiengang_kz)
]);
@@ -190,6 +190,24 @@ export default {
if (!currentNode)
return;
const currentSelectedKey = Object.keys(this.selectedKey).find(Boolean);
if (currentSelectedKey) {
if (currentSelectedKey == currentKey)
return;
/**
* Do not select a new entry if the current is a child of the new one.
* This happens if a child entry of a new stg is selected and the router
* tries to select the stg root entry (because subtrees do not have
* routes yet)
*/
const isChild = this.findNodeByKey(
currentSelectedKey,
currentNode.children
);
if (isChild)
return;
}
for (let i = 1; i < parts.length; i++)
{
this.expandedKeys[currentNode.key] = true;