infobar.vue 1.3 KB
Newer Older
schneider210's avatar
schneider210 committed
1
<template>
nwindis's avatar
nwindis committed
2
  <div>
nwindis's avatar
nwindis committed
3
    <h1 class="title text-h4 text-bold text-uppercase">
4
      <span>{{ cut(collectiontitle) }}</span>
nwindis's avatar
nwindis committed
5
6
7
8
9
10
      <q-icon
        class="q-pb-xs q-pr-sm q-pl-sm"
        size="sm"
        :color="$q.dark.isActive ? 'white' : 'accent'"
        :name="fasChevronRight"
        />
11
      <span>{{ cut(manifesttitle) }}</span>
nwindis's avatar
nwindis committed
12
13
14
15
16
17
      <q-icon
        class="q-pb-xs q-pr-sm q-pl-sm"
        size="sm"
        :color="$q.dark.isActive ? 'white' : 'accent'"
        :name="fasChevronRight"
        />
18
      <span>{{ itemlabel }}</span>
19
20
    </h1>
  </div>
schneider210's avatar
schneider210 committed
21
22
23
</template>

<script>
24
25
import { fasChevronRight } from '@quasar/extras/fontawesome-v5';

schneider210's avatar
schneider210 committed
26
27
28
export default {
  name: 'Infobar',
  props: {
29
    collectiontitle: String,
30
    itemlabel: String,
schneider210's avatar
schneider210 committed
31
32
33
34
35
36
37
38
39
40
41
42
43
    manifests: Array,
  },
  data() {
    return {
      sequenceindex: 0,
    };
  },
  computed: {
    manifesttitle() {
      return this.manifests[this.sequenceindex].label;
    },
  },
  methods: {
44
    cut(s) {
schneider210's avatar
schneider210 committed
45
46
47
      return s.length > 30 ? `${s.substring(0, 26)} ...` : s;
    },
  },
48
49
50
  created() {
    this.fasChevronRight = fasChevronRight;
  },
schneider210's avatar
schneider210 committed
51
  mounted() {
52
53
    this.$root.$on('update-sequence-index', (index) => {
      this.sequenceindex = index;
schneider210's avatar
schneider210 committed
54
55
56
57
    });
  },
};
</script>
nwindis's avatar
nwindis committed
58
59
60
61

<style lang="scss" scoped>
.title {
  font-size: 28px !important;
nwindis's avatar
nwindis committed
62
  letter-spacing: 2px;
nwindis's avatar
nwindis committed
63
64
}
</style>