logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git

draft_buttons.vue (2043B)


  1. <!-- this is a helper exclusive to Setting components -->
  2. <!-- TODO make it reusable -->
  3. <template>
  4. <span
  5. class="DraftButtons"
  6. >
  7. <Popover
  8. v-if="$parent.isDirty"
  9. trigger="hover"
  10. normal-button
  11. :trigger-attrs="{ 'aria-label': $t('settings.commit_value_tooltip') }"
  12. @click="$parent.commitDraft"
  13. >
  14. <template #trigger>
  15. {{ $t('settings.commit_value') }}
  16. </template>
  17. <template #content>
  18. <div class="modified-tooltip">
  19. {{ $t('settings.commit_value_tooltip') }}
  20. </div>
  21. </template>
  22. </Popover>
  23. <Popover
  24. v-if="$parent.isDirty"
  25. trigger="hover"
  26. normal-button
  27. :trigger-attrs="{ 'aria-label': $t('settings.reset_value_tooltip') }"
  28. @click="$parent.reset"
  29. >
  30. <template #trigger>
  31. {{ $t('settings.reset_value') }}
  32. </template>
  33. <template #content>
  34. <div class="modified-tooltip">
  35. {{ $t('settings.reset_value_tooltip') }}
  36. </div>
  37. </template>
  38. </Popover>
  39. <Popover
  40. v-if="$parent.canHardReset"
  41. trigger="hover"
  42. normal-button
  43. :trigger-attrs="{ 'aria-label': $t('settings.hard_reset_value_tooltip') }"
  44. @click="$parent.hardReset"
  45. >
  46. <template #trigger>
  47. {{ $t('settings.hard_reset_value') }}
  48. </template>
  49. <template #content>
  50. <div class="modified-tooltip">
  51. {{ $t('settings.hard_reset_value_tooltip') }}
  52. </div>
  53. </template>
  54. </Popover>
  55. </span>
  56. </template>
  57. <script>
  58. import Popover from 'src/components/popover/popover.vue'
  59. import { library } from '@fortawesome/fontawesome-svg-core'
  60. import { faWrench } from '@fortawesome/free-solid-svg-icons'
  61. library.add(
  62. faWrench
  63. )
  64. export default {
  65. components: { Popover },
  66. props: ['changed']
  67. }
  68. </script>
  69. <style lang="scss">
  70. .DraftButtons {
  71. display: inline-block;
  72. position: relative;
  73. .button-default {
  74. margin-left: 0.5em;
  75. }
  76. }
  77. .draft-tooltip {
  78. margin: 0.5em 1em;
  79. min-width: 10em;
  80. text-align: center;
  81. }
  82. </style>