This commit is contained in:
2021-04-29 22:54:04 +00:00
parent 40f1d67607
commit f376187418
6 changed files with 68 additions and 41 deletions

View File

@@ -1,5 +1,7 @@
/* xxxeslint-disable */
import { VMain } from "vuetify/lib";
/////////////////////////////////
// Menu utils and handlers
//
@@ -44,7 +46,8 @@ export default {
vm.appBar.isMain = ctx.isMain;
vm.appBar.icon = ctx.icon;
vm.appBar.title = ctx.title;
vm.appBar.title = ""; //this prevents fou[translated]c
vm.appBar.readOnly = ctx.readOnly;
if (ctx.readOnly === true) {
@@ -52,20 +55,30 @@ export default {
} else {
vm.appBar.color = ctx.isMain ? "primary" : "secondary";
}
let recordName = "";
//ctx.title if set is a Translation key
//ctx.formData.recordName is the object name or serial number or whatever identifies it uniquely
let recordName = "";
if (ctx && ctx.formData && ctx.formData.recordName) {
recordName = ctx.formData.recordName;
}
let hasRecordName = recordName != "";
if (ctx.title) {
//it has a title translation key
if (hasRecordName) {
//recordname takes all precedence in AppBar in order to conserve space (narrow view etc)
//also it just looks cleaner, the icon is already there to indicate where the user is at
//vm.appBar.title = `${ctx.title}:${recordName}`;
vm.appBar.title = recordName;
document.title = `${recordName} - ${vm.$ay.t(ctx.title)} AyaNova `;
} else {
vm.appBar.title = ctx.title;
document.title = `${vm.$ay.t(ctx.title)} ${recordName}`;
}
} else {
if (hasRecordName) {
//not title but has record name
vm.appBar.title = recordName;
document.title = `${recordName} AyaNova`;
} else {
document.title = "AyaNova";