|
14 | 14 | <img class="kp-logo" :src="getLogo(sectionConfig['header logo'])"> |
15 | 15 | </p> |
16 | 16 | </div> |
17 | | - <ul v-if="!!researchMenu"> |
18 | | - <template v-if="addSearch"> |
19 | | - <li class="menu menu-search"> |
20 | | - <a @click="activateSearch"> |
21 | | - <svg viewBox="0 0 24 24" fill="none" stroke="#1c5084" stroke-width=".5" xmlns="http://www.w3.org/2000/svg"> |
22 | | - <path fill="#1c5084" fill-rule="evenodd" clip-rule="evenodd" d="M15 10.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Zm-.82 4.74a6 6 0 1 1 1.06-1.06l4.79 4.79-1.06 1.06-4.79-4.79Z"/> |
23 | | - </svg> |
24 | | - Search |
25 | | - </a> |
26 | | - </li> |
27 | | - </template> |
28 | | - <li |
29 | | - v-for="menu in (researchMenu.length ? researchMenu : researchMenu.menu)" |
30 | | - :key="menu.label" |
31 | | - class="menu" |
32 | | - > |
33 | | - <a :href="menu.link">{{ menu.label }}</a> |
34 | | - <ul v-if="!!menu.subMenu" class="sub-menu-wrapper"> |
35 | | - <li |
36 | | - v-for="subMenu in menu.subMenu" |
37 | | - :key="subMenu.label" |
38 | | - class="sub-menu" |
39 | | - > |
40 | | - <a :href="subMenu.link">{{ subMenu.label }}</a> |
41 | | - </li> |
42 | | - </ul> |
43 | | - </li> |
44 | | - </ul> |
45 | | - |
46 | | - <ul v-if="!!sectionConfig"> |
47 | | - <li |
48 | | - v-for="menu in sectionConfig.menu.items" |
49 | | - :key="menu.label" |
50 | | - class="menu" |
51 | | - > |
52 | | - <a :href="getLink(menu.link)">{{ menu.label }}</a> |
53 | | - <ul v-if="!!menu.subMenu" class="sub-menu-wrapper"> |
54 | | - <li |
55 | | - v-for="subMenu in menu.subMenu" |
56 | | - :key="subMenu.label" |
57 | | - class="sub-menu" |
58 | | - > |
59 | | - <a :href="getLink(subMenu.link)">{{ subMenu.label }}</a> |
| 17 | + <div style="display:flex; align-items: end; gap:10px"> |
| 18 | + <ul v-if="!!researchMenu"> |
| 19 | + <template v-if="addSearch"> |
| 20 | + <li class="menu menu-search"> |
| 21 | + <a @click="activateSearch"> |
| 22 | + <svg viewBox="0 0 24 24" fill="none" stroke="#1c5084" stroke-width=".5" xmlns="http://www.w3.org/2000/svg"> |
| 23 | + <path fill="#1c5084" fill-rule="evenodd" clip-rule="evenodd" d="M15 10.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Zm-.82 4.74a6 6 0 1 1 1.06-1.06l4.79 4.79-1.06 1.06-4.79-4.79Z"/> |
| 24 | + </svg> |
| 25 | + Search |
| 26 | + </a> |
60 | 27 | </li> |
61 | | - </ul> |
62 | | - </li> |
63 | | - </ul> |
| 28 | + </template> |
| 29 | + <li |
| 30 | + v-for="menu in (researchMenu.length ? researchMenu : researchMenu.menu)" |
| 31 | + :key="menu.label" |
| 32 | + class="menu" |
| 33 | + > |
| 34 | + <a :href="menu.link">{{ menu.label }}</a> |
| 35 | + <ul v-if="!!menu.subMenu" class="sub-menu-wrapper"> |
| 36 | + <li |
| 37 | + v-for="subMenu in menu.subMenu" |
| 38 | + :key="subMenu.label" |
| 39 | + class="sub-menu" |
| 40 | + > |
| 41 | + <a :href="subMenu.link">{{ subMenu.label }}</a> |
| 42 | + </li> |
| 43 | + </ul> |
| 44 | + </li> |
| 45 | + </ul> |
| 46 | + |
| 47 | + <ul v-if="!!sectionConfig"> |
| 48 | + <li |
| 49 | + v-for="menu in sectionConfig.menu.items" |
| 50 | + :key="menu.label" |
| 51 | + class="menu" |
| 52 | + > |
| 53 | + <a :href="getLink(menu.link)">{{ menu.label }}</a> |
| 54 | + <ul v-if="!!menu.subMenu" class="sub-menu-wrapper"> |
| 55 | + <li |
| 56 | + v-for="subMenu in menu.subMenu" |
| 57 | + :key="subMenu.label" |
| 58 | + class="sub-menu" |
| 59 | + > |
| 60 | + <a :href="getLink(subMenu.link)">{{ subMenu.label }}</a> |
| 61 | + </li> |
| 62 | + </ul> |
| 63 | + </li> |
| 64 | + </ul> |
| 65 | + |
| 66 | + <div class="menu-cfde-wheel" v-if="researchMenu?.['custom components']?.['cfde-wheel']" style="height:40px; cursor:pointer" @click="addCfdeWheel" title="CFDE Wheel"> |
| 67 | + <img src="https://hugeampkpncms.org/sites/default/files/users/user32/kc_icons/cfde_unified_icon.png" style="max-height: 100%;"/> |
| 68 | + </div> |
| 69 | + </div> |
| 70 | + |
64 | 71 | <div class="menu-search-container" ref="searchContainer"></div> |
| 72 | + |
65 | 73 | </div> |
66 | 74 | </template> |
67 | 75 |
|
68 | 76 | <script> |
69 | 77 | import Vue from "vue"; |
70 | 78 | import EventBus from "@/utils/eventBus"; |
71 | 79 | import ResearchSingleSearchCFDE from "@/components/researchPortal/ResearchSingleSearchCFDE.vue"; |
| 80 | +import cfdeWheel from "./customComponents/cfdeWheel.vue"; |
72 | 81 |
|
73 | 82 | export default Vue.component("research-page-header", { |
74 | 83 | props: ["researchMenu","phenotypes", "utils", "headerLogo","sectionConfig","utils"], |
@@ -238,6 +247,26 @@ export default Vue.component("research-page-header", { |
238 | 247 | temp.innerHTML = `<div style='position:sticky; bottom:0; width:100vw; padding:10px; z-index:50; background: #f7ab85; text-align:center;'>This repository is under review for potential modification in compliance with Administration directives.</div>`; |
239 | 248 | document.body.appendChild(temp.firstChild); |
240 | 249 | } |
| 250 | + }, |
| 251 | + addCfdeWheel(){ |
| 252 | + // dynamically create and mount the component with its props |
| 253 | + const CFDEwheelClass = Vue.extend({ |
| 254 | + render(h) { |
| 255 | + return h(cfdeWheel, { |
| 256 | + on: { |
| 257 | + close: () => { |
| 258 | + document.body.removeChild(wheelInstance.$el); |
| 259 | + wheelInstance.$destroy(); // clean up |
| 260 | + } |
| 261 | + } |
| 262 | + }) |
| 263 | + }, |
| 264 | + }); |
| 265 | + const wheelInstance = new CFDEwheelClass(); |
| 266 | +
|
| 267 | + // mount component and append it to body |
| 268 | + wheelInstance.$mount(); |
| 269 | + document.body.appendChild(wheelInstance.$el); |
241 | 270 | } |
242 | 271 | }, |
243 | 272 | computed: {}, |
|
0 commit comments