mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
Merge branch 'feature-25999/LvMenuFix'
This commit is contained in:
@@ -14,6 +14,16 @@ export default {
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
c4_disabled: function (menuItem) {
|
||||
if (!this.c4_link(menuItem) && !menuItem.c4_moodle_links?.length) {
|
||||
return true;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
c4_target: function (menuItem) {
|
||||
if (menuItem.c4_moodle_links?.length > 0) return null;
|
||||
return menuItem.c4_target ?? null;
|
||||
},
|
||||
selectMenu: function (menuItem, index = null) {
|
||||
|
||||
// early return if link is #
|
||||
@@ -37,7 +47,7 @@ export default {
|
||||
if (!menuItem) return null;
|
||||
if (Array.isArray(menuItem.c4_moodle_links) && menuItem.c4_moodle_links.length)
|
||||
{
|
||||
return '#';
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -50,9 +60,9 @@ export default {
|
||||
<div v-else>
|
||||
<div class="container" :class="containerStyles">
|
||||
<div class="row g-2 justify-content-center" :class="rowStyles">
|
||||
<div style="min-height:150px; min-width:150px;" class="col-12 col-lg-6 col-xl-4" v-for="(menuItem, index) in menu" :key="index">
|
||||
<a :id="menuItem.name" :class="{'dropdown-toggle':menuItem.c4_moodle_links?.length }" :target="menuItem.c4_target ?? null" role="button" :href="c4_link(menuItem)"
|
||||
:disabled="!c4_link(menuItem)?true:null"
|
||||
<div style="min-height:150px; min-width:150px;" class="col-12 col-lg-6 col-xl-4" v-for="(menuItem, index) in menu" :key="index">
|
||||
<a :id="menuItem.name" :class="{'dropdown-toggle':menuItem.c4_moodle_links?.length }" role="button" :href="c4_link(menuItem)"
|
||||
:disabled="c4_disabled(menuItem)" :data-bs-toggle="menuItem.c4_moodle_links?.length?'dropdown':null"
|
||||
class="fhc-entry p-2 w-100 text-wrap border border-1 rounded-3 d-flex flex-column align-items-center justify-content-center text-center text-decoration-none link-dark h-100">
|
||||
<img :src="menuItem.c4_icon" :alt="menuItem.name" />
|
||||
<p @click="selectMenu(menuItem)" class="w-100 mt-2">{{menuItem.name}}</p>
|
||||
|
||||
Reference in New Issue
Block a user