From 821102f69beef85fc6560173a392b3a402e8f923 Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Fri, 16 Nov 2018 14:53:04 +0000 Subject: [PATCH] Limited length of tab title --- frontend/src/views/ViewObservations.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/ViewObservations.vue b/frontend/src/views/ViewObservations.vue index 3c6a6a4..6046b30 100644 --- a/frontend/src/views/ViewObservations.vue +++ b/frontend/src/views/ViewObservations.vue @@ -56,7 +56,7 @@ -

{{ observation.date }}
{{ observation.whom }} {{ observation.type }}
{{ observation.observed }}

+

{{ observation.date }}
{{ observation.whom }} {{ observation.type }}
{{ shortenedString(observation.observed) }}

{{ observation.date }}, {{ observation.whom }}
{{ observation.type }}, {{ observation.observed }}

Observed by: {{ tutor.name }}

@@ -274,6 +274,14 @@ export default { this.errorMessage = error.response.data; this.$refs.errorModal.show(); }); + }, + shortenedString: function(data) { + if(data.len < 20){ + return data; + } + else{ + return data.substr(0, 20) + "..."; + } } }, watch: {