Skip to content
Snippets Groups Projects
Commit 696ee6c2 authored by Thomas Hackl's avatar Thomas Hackl
Browse files

Resolve "Fehlermeldung TypeError: this.initialNavigation is null auf Seiten,...

Resolve "Fehlermeldung TypeError: this.initialNavigation is null auf Seiten, die sich nicht in die Navigation einhängen"

Closes #2435

Merge request studip/studip!1627
parent 5e45e451
No related branches found
No related tags found
No related merge requests found
Pipeline #12132 passed
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
tabindex="0" tabindex="0"
> >
<span class="navigation-icon"> <span class="navigation-icon">
<studip-icon v-if="isCourse" shape="seminar" role="info_alt" size="24" alt=""></studip-icon> <studip-icon v-if="isCourse" shape="seminar" role="info_alt" :size="24" alt=""></studip-icon>
<img v-if="item.icon" :src="iconUrl" width="24" alt="" /> <img v-if="item.icon" :src="iconUrl" width="24" alt="" />
</span> </span>
<span class="navigation-text"> <span class="navigation-text">
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
@keydown.prevent.enter="moveTo(item.path)" @keydown.prevent.enter="moveTo(item.path)"
@keydown.prevent.space="moveTo(item.path)" @keydown.prevent.space="moveTo(item.path)"
> >
<studip-icon shape="arr_1right" role="info_alt" size="20" alt=""></studip-icon> <studip-icon shape="arr_1right" role="info_alt" :size="20" alt=""></studip-icon>
</button> </button>
</template> </template>
<div v-else class="navigation-title"> <div v-else class="navigation-title">
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
:title="navigateToText(item.title)" :title="navigateToText(item.title)"
:aria-label="navigateToText(item.title)" :aria-label="navigateToText(item.title)"
> >
<studip-icon v-if="isCourse" shape="seminar" role="info_alt" size="24" alt=""></studip-icon> <studip-icon v-if="isCourse" shape="seminar" role="info_alt" :size="24" alt=""></studip-icon>
<img v-if="item.icon" :src="iconUrl" width="24" alt="" /> <img v-if="item.icon" :src="iconUrl" width="24" alt="" />
{{ item.title }} {{ item.title }}
</a> </a>
......
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
<div v-if="hasSidebar" class="contentbar-nav" ref="leftNav"> <div v-if="hasSidebar" class="contentbar-nav" ref="leftNav">
<button :class="sidebarIconClasses" @click.prevent="toggleSidebar" id="toggle-sidebar" <button :class="sidebarIconClasses" @click.prevent="toggleSidebar" id="toggle-sidebar"
:title="$gettext('Sidebar öffnen')"> :title="$gettext('Sidebar öffnen')">
<studip-icon shape="sidebar3" size="24" ref="sidebarIcon" <studip-icon shape="sidebar3" :size="24" ref="sidebarIcon"
alt=""></studip-icon> alt=""></studip-icon>
</button> </button>
</div> </div>
<div class="contentbar-wrapper-left"> <div class="contentbar-wrapper-left">
<studip-icon :shape="icon" size="24" role="info" class="text-bottom contentbar-icon"></studip-icon> <studip-icon :shape="icon" :size="24" role="info" class="text-bottom contentbar-icon"></studip-icon>
<nav class="contentbar-breadcrumb" ref="breadcrumbs"> <nav class="contentbar-breadcrumb" ref="breadcrumbs">
<span>{{ title }}</span> <span>{{ title }}</span>
</nav> </nav>
......
...@@ -150,7 +150,8 @@ export default { ...@@ -150,7 +150,8 @@ export default {
iconSize: 28, iconSize: 28,
showMenu: false, showMenu: false,
activeItem: this.navigation.activated.at(-1) ?? 'start', activeItem: this.navigation.activated.at(-1) ?? 'start',
currentNavigation: this.findItem(this.navigation.activated.at(0) ?? 'start', studipNavigation), currentNavigation: this.findItem(this.navigation.activated.at(0) ?? 'start', studipNavigation)
?? this.studipNavigation,
initialNavigation: {}, initialNavigation: {},
initialTitle: '', initialTitle: '',
isAdmin: ['root','admin'].includes(this.me.perm), isAdmin: ['root','admin'].includes(this.me.perm),
...@@ -259,7 +260,7 @@ export default { ...@@ -259,7 +260,7 @@ export default {
return found; return found;
} }
// No children left to search through, we are doomed. // No children left to search through, we are doomed.
} else { } else {
return null; return null;
} }
...@@ -345,7 +346,8 @@ export default { ...@@ -345,7 +346,8 @@ export default {
*/ */
moveTo(path) { moveTo(path) {
this.avatarMenuOpen = false; this.avatarMenuOpen = false;
this.currentNavigation = this.findItem(path ? path : '/', this.studipNavigation); this.currentNavigation =
this.findItem(path ? path : '/', this.studipNavigation) ?? this.studipNavigation;
this.$nextTick(() => { this.$nextTick(() => {
const current = document.querySelector('.navigation-current') const current = document.querySelector('.navigation-current')
? document.querySelector('.navigation-current .navigation-title button') ? document.querySelector('.navigation-current .navigation-title button')
......
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