logo

pleroma-fe

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

status_bookmark_folder_menu.js (894B)


  1. import { library } from '@fortawesome/fontawesome-svg-core'
  2. import { faChevronRight, faFolder } from '@fortawesome/free-solid-svg-icons'
  3. import { mapState } from 'vuex'
  4. import Popover from '../popover/popover.vue'
  5. library.add(faChevronRight, faFolder)
  6. const StatusBookmarkFolderMenu = {
  7. props: [
  8. 'status'
  9. ],
  10. data () {
  11. return {}
  12. },
  13. components: {
  14. Popover
  15. },
  16. computed: {
  17. ...mapState({
  18. folders: state => state.bookmarkFolders.allFolders
  19. }),
  20. folderId () {
  21. return this.status.bookmark_folder_id
  22. }
  23. },
  24. methods: {
  25. toggleFolder (id) {
  26. const value = id === this.folderId ? null : id
  27. this.$store.dispatch('bookmark', { id: this.status.id, bookmark_folder_id: value })
  28. .then(() => this.$emit('onSuccess'))
  29. .catch(err => this.$emit('onError', err.error.error))
  30. }
  31. }
  32. }
  33. export default StatusBookmarkFolderMenu