logo

pleroma-fe

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

timeline_menu.vue (2056B)


  1. <template>
  2. <Popover
  3. trigger="click"
  4. class="TimelineMenu"
  5. :class="{ 'open': isOpen }"
  6. :bound-to="{ x: 'container' }"
  7. bound-to-selector=".Timeline"
  8. popover-class="timeline-menu-popover popover-default"
  9. @show="openMenu"
  10. @close="() => isOpen = false"
  11. >
  12. <template #content>
  13. <ListsMenuContent
  14. v-if="useListsMenu"
  15. :show-pin="false"
  16. class="timelines"
  17. />
  18. <ul v-else>
  19. <NavigationEntry
  20. v-for="item in timelinesList"
  21. :key="item.name"
  22. :show-pin="false"
  23. :item="item"
  24. />
  25. </ul>
  26. </template>
  27. <template #trigger>
  28. <span class="button-unstyled title timeline-menu-title">
  29. <span class="timeline-title">{{ timelineName() }}</span>
  30. <span>
  31. <FAIcon
  32. size="sm"
  33. icon="chevron-down"
  34. />
  35. </span>
  36. <span
  37. class="click-blocker"
  38. @click="blockOpen"
  39. />
  40. </span>
  41. </template>
  42. </Popover>
  43. </template>
  44. <script src="./timeline_menu.js"></script>
  45. <style lang="scss">
  46. .timeline-menu-popover {
  47. min-width: 24rem;
  48. max-width: 100vw;
  49. margin-top: 0.6rem;
  50. font-size: 1rem;
  51. border-top-right-radius: 0;
  52. border-top-left-radius: 0;
  53. ul {
  54. list-style: none;
  55. margin: 0;
  56. padding: 0;
  57. }
  58. }
  59. .TimelineMenu {
  60. margin-right: auto;
  61. min-width: 0;
  62. .popover-trigger-button {
  63. vertical-align: bottom;
  64. }
  65. .panel::after {
  66. border-top-right-radius: 0;
  67. border-top-left-radius: 0;
  68. }
  69. .timeline-menu-title {
  70. margin: 0;
  71. cursor: pointer;
  72. user-select: none;
  73. width: 100%;
  74. display: flex;
  75. .timeline-menu-name {
  76. overflow: hidden;
  77. text-overflow: ellipsis;
  78. white-space: nowrap;
  79. }
  80. svg {
  81. margin-left: 0.6em;
  82. transition: transform 100ms;
  83. }
  84. .click-blocker {
  85. cursor: default;
  86. flex-grow: 1;
  87. }
  88. }
  89. &.open .timeline-menu-title svg {
  90. transform: rotate(180deg);
  91. }
  92. .panel {
  93. box-shadow: var(--popoverShadow);
  94. }
  95. }
  96. </style>