This commit is contained in:
2019-12-30 20:35:52 +00:00
parent e30fa5b0bd
commit f3f2987550
2 changed files with 23 additions and 6 deletions

View File

@@ -14,12 +14,18 @@ export default {
if (ctx.icon && !ctx.icon.startsWith("fa-")) {
ctx.icon = "fa-" + ctx.icon;
}
vm.appBar.icon = ctx.icon;
vm.appBar.title = ctx.title;
//Parse the forms object type if present
var formAyaType = 0;
if (ctx.formData && ctx.formData.ayaType != undefined) {
formAyaType = ctx.formData.ayaType;
}
//set the help url if presented or default to the User section intro
vm.appBar.helpUrl = ctx.helpUrl ? ctx.helpUrl : "user-intro";
vm.appBar.menuItems = [];
//CONTEXT TOP PORTION
@@ -42,19 +48,24 @@ export default {
//LOGOUT
vm.appBar.menuItems.push({
title: window.$gz.locale.get("Logout"),
icon: "sign-out-alt",
key: "app:logout"
});
//divider
vm.appBar.menuItems.push({ divider: true, inset: false });
//SEARCH
vm.appBar.menuItems.push({
title: window.$gz.locale.get("Search"),
icon: "search",
key: "app:search",
data: formAyaType
});
//HELP
vm.appBar.menuItems.push({
title: window.$gz.locale.get("MenuHelp"),
icon: "question-circle",
key: "app:help",
data: vm.appBar.helpUrl
@@ -149,6 +160,12 @@ export default {
var helpurl = vm.$store.state.helpUrl + item.data;
window.open(helpurl, "_blank");
break;
case "search":
vm.$router.push({
name: "home-search",
params: { ayatype: item.data }
});
break;
case "logout":
vm.$router.push("/login");
break;

View File

@@ -77,7 +77,7 @@ export default new Router({
import(/* webpackChunkName: "home" */ "./views/home-dashboard.vue")
},
{
path: "/home-search",
path: "/home-search/:ayatype",
name: "home-search",
component: () =>
import(/* webpackChunkName: "home" */ "./views/home-search.vue")