Skip to content
Snippets Groups Projects
Commit 2f4e1930 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Refactored header title update to CommonUtil

parent f1258de8
Branches
No related tags found
No related merge requests found
...@@ -74,5 +74,8 @@ export default { ...@@ -74,5 +74,8 @@ export default {
CONST_FIELD_MANDATORY : '<font color=red>*</font>', CONST_FIELD_MANDATORY : '<font color=red>*</font>',
setHeaderTitle : function(headerTitle) {
document.getElementById("appHeader").innerHTML = headerTitle;
}
} }
</script> </script>
\ No newline at end of file
...@@ -22,8 +22,7 @@ ...@@ -22,8 +22,7 @@
--> -->
<template> <template>
<div id="divCropCategory"> <div id="divCropCategory">
<h1>Crop Category List</h1> <div v-show="isCropIdsNotAvailable" class="alert alert-info" role="alert">
<div v-show="isCropIdsNotAvailable" class="alert alert-warning" role="alert">
{{ $t("crop.category.empty.alert") }} {{ $t("crop.category.empty.alert") }}
</div> </div>
<ul class="list-group" style="text-align: left"> <ul class="list-group" style="text-align: left">
......
...@@ -804,7 +804,7 @@ export default { ...@@ -804,7 +804,7 @@ export default {
mounted(){ mounted(){
document.getElementById("appHeader").innerHTML=this.$i18n.t("observation.msg"); CommonUtil.setHeaderTitle(this.$i18n.t("observation.msg"));
var btnBack = document.getElementById("btnBack"); var btnBack = document.getElementById("btnBack");
var navDiv = document.getElementById("vipsobsappmenu"); var navDiv = document.getElementById("vipsobsappmenu");
btnBack.style.top=(navDiv.offsetHeight) + "px"; btnBack.style.top=(navDiv.offsetHeight) + "px";
......
...@@ -117,23 +117,24 @@ export default { ...@@ -117,23 +117,24 @@ export default {
return DateTime.fromISO(timeStr).toLocaleString(DateTime.DATETIME_MED); return DateTime.fromISO(timeStr).toLocaleString(DateTime.DATETIME_MED);
} }
}, },
mounted() { mounted() {
document.getElementById("appHeader").innerHTML=this.$i18n.t("observationlist.heading"); CommonUtil.setHeaderTitle(this.$i18n.t("observationlist.heading"));
let valueObj = {"name":CommonUtil.CONST_STORAGE_OBSERVATION_LIST,"complete":false}; //document.getElementById("appHeader").innerHTML=;
//this.$refs.Sync.syncObservationSendPrepare(valueObj); let valueObj = {"name":CommonUtil.CONST_STORAGE_OBSERVATION_LIST,"complete":false};
this.CONST_URL_DOMAIN = CommonUtil.CONST_URL_DOMAIN; //this.$refs.Sync.syncObservationSendPrepare(valueObj);
let strUUID = localStorage.getItem(CommonUtil.CONST_STORAGE_UUID); this.CONST_URL_DOMAIN = CommonUtil.CONST_URL_DOMAIN;
if(strUUID) let strUUID = localStorage.getItem(CommonUtil.CONST_STORAGE_UUID);
{ if(strUUID)
this.getObservationsFromStore(); {
} this.getObservationsFromStore();
// Making it globally available, so that e.g. the Sync component can update the list }
// calling e.g. this.$root.sharedState.observationListComponent.getObservationsFromStore(); // Making it globally available, so that e.g. the Sync component can update the list
this.$root.sharedState.observationListComponent = this; // calling e.g. this.$root.sharedState.observationListComponent.getObservationsFromStore();
this.$root.sharedState.observationListComponent = this;
"Mine observasjoner";
//this.$root.sharedState.appHeader = this.title; "Mine observasjoner";
} //this.$root.sharedState.appHeader = this.title;
}
} }
</script> </script>
......
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
}, },
mounted() { mounted() {
document.getElementById("appHeader").innerHTML=this.$i18n.t("placeslist.heading"); CommonUtil.setHeaderTitle(this.$i18n.t("placeslist.heading"));
this.CONST_URL_DOMAIN = CommonUtil.CONST_URL_DOMAIN; this.CONST_URL_DOMAIN = CommonUtil.CONST_URL_DOMAIN;
/** TODO fetch server should be used in sync process and not here */ /** TODO fetch server should be used in sync process and not here */
//this.fetchFromServer(); //this.fetchFromServer();
......
...@@ -53,7 +53,7 @@ export default { ...@@ -53,7 +53,7 @@ export default {
}, },
}, },
mounted() { mounted() {
document.getElementById("appHeader").innerHTML=this.$i18n.t("settings.heading"); CommonUtil.setHeaderTitle(this.$i18n.t("settings.heading"));
} }
} }
</script> </script>
\ No newline at end of file
...@@ -6,6 +6,7 @@ import router from './router' ...@@ -6,6 +6,7 @@ import router from './router'
import i18n from './i18n' import i18n from './i18n'
import LoginSystem from '@/components/LoginSystem' import LoginSystem from '@/components/LoginSystem'
import Welcome from '@/components/Welcome' import Welcome from '@/components/Welcome'
import CommonUtil from '@/components/CommonUtil'
...@@ -39,7 +40,7 @@ const init = () => { ...@@ -39,7 +40,7 @@ const init = () => {
i18n, i18n,
created() { created() {
document.getElementById("appHeader").innerHTML=this.$i18n.t("index.header"); CommonUtil.setHeaderTitle(this.$i18n.t("index.header"));
console.info("Vue is ready"); console.info("Vue is ready");
console.info("User's preferred language is " + navigator.language); console.info("User's preferred language is " + navigator.language);
// Are we logged in already? // Are we logged in already?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment