aboutsummaryrefslogtreecommitdiff
path: root/src/components/settings_modal/helpers/modified_indicator.vue
blob: a747cebd22343dfe56a814e626e029fc56b32b79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<template>
  <span
    v-if="changed"
    class="ModifiedIndicator"
  >
    <Popover
      trigger="hover"
      :trigger-attrs="{ 'aria-label': $t('settings.setting_changed') }"
    >
      <template #trigger>
        &nbsp;
        <FAIcon
          icon="wrench"
        />
      </template>
      <template #content>
        <div class="modified-tooltip">
          {{ $t(messageKey) }}
        </div>
      </template>
    </Popover>
  </span>
</template>

<script>
import Popover from 'src/components/popover/popover.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import { faWrench } from '@fortawesome/free-solid-svg-icons'

library.add(
  faWrench
)

export default {
  components: { Popover },
  props: {
    changed: Boolean,
    messageKey: {
      type: String,
      default: 'settings.setting_changed'
    }
  }
}
</script>

<style lang="scss">
.ModifiedIndicator {
  display: inline-block;
  position: relative;
}

.modified-tooltip {
  margin: 0.5em 1em;
  min-width: 10em;
  text-align: center;
}
</style>