fix bookmark folders not being pinnable
This commit is contained in:
parent
92c82a0a34
commit
031f8e65e6
6 changed files with 28 additions and 3 deletions
|
@ -3,6 +3,9 @@ import NavigationEntry from 'src/components/navigation/navigation_entry.vue'
|
|||
import { getBookmarkFolderEntries } from 'src/components/navigation/filter.js'
|
||||
|
||||
export const BookmarkFoldersMenuContent = {
|
||||
props: [
|
||||
'showPin'
|
||||
],
|
||||
components: {
|
||||
NavigationEntry
|
||||
},
|
||||
|
|
|
@ -7,10 +7,12 @@
|
|||
label: 'nav.all_bookmarks',
|
||||
icon: 'bookmark'
|
||||
}"
|
||||
:show-pin="showPin"
|
||||
/>
|
||||
<NavigationEntry
|
||||
v-for="item in folders"
|
||||
:key="item.id"
|
||||
:show-pin="showPin"
|
||||
:item="item"
|
||||
/>
|
||||
</ul>
|
||||
|
|
|
@ -113,6 +113,7 @@
|
|||
:class="{ '-expanded': showBookmarkFolders }"
|
||||
>
|
||||
<BookmarkFoldersMenuContent
|
||||
:show-pin="editMode || forceEditMode"
|
||||
class="timelines"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -24,6 +24,6 @@ export const getBookmarkFolderEntries = state => state.bookmarkFolders.allFolder
|
|||
routeObject: { name: 'bookmark-folder', params: { id: folder.id } },
|
||||
labelRaw: folder.name,
|
||||
iconEmoji: folder.emoji,
|
||||
iconEmojiUrl: folder.emoji_url,
|
||||
iconEmojiUrl: console.log(folder) || folder.emoji_url,
|
||||
iconLetter: folder.name[0]
|
||||
}))
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import { mapState } from 'vuex'
|
||||
import { TIMELINES, ROOT_ITEMS, routeTo } from 'src/components/navigation/navigation.js'
|
||||
import { getListEntries, filterNavigation } from 'src/components/navigation/filter.js'
|
||||
import { getBookmarkFolderEntries, getListEntries, filterNavigation } from 'src/components/navigation/filter.js'
|
||||
|
||||
import StillImage from 'src/components/still-image/still-image.vue'
|
||||
|
||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||
import {
|
||||
|
@ -34,12 +36,16 @@ const NavPanel = {
|
|||
return routeTo(item, this.currentUser)
|
||||
}
|
||||
},
|
||||
components: {
|
||||
StillImage
|
||||
},
|
||||
computed: {
|
||||
getters () {
|
||||
return this.$store.getters
|
||||
},
|
||||
...mapState({
|
||||
lists: getListEntries,
|
||||
bookmarks: getBookmarkFolderEntries,
|
||||
currentUser: state => state.users.currentUser,
|
||||
followRequestCount: state => state.api.followRequests.length,
|
||||
privateMode: state => state.instance.private,
|
||||
|
@ -70,6 +76,7 @@ const NavPanel = {
|
|||
.filter(([k]) => this.pinnedItems.has(k))
|
||||
.map(([k, v]) => ({ ...v, name: k })),
|
||||
...this.lists.filter((k) => this.pinnedItems.has(k.name)),
|
||||
...this.bookmarks.filter((k) => this.pinnedItems.has(k.name)),
|
||||
...Object
|
||||
.entries({ ...ROOT_ITEMS })
|
||||
.filter(([k]) => this.pinnedItems.has(k))
|
||||
|
|
|
@ -14,9 +14,14 @@
|
|||
:icon="item.icon"
|
||||
/>
|
||||
<span
|
||||
v-if="item.iconLetter"
|
||||
v-if="item.iconLetter && !item.iconEmoji"
|
||||
class="iconLetter fa-scale-110 fa-old-padding"
|
||||
>{{ item.iconLetter }}</span>
|
||||
<StillImage
|
||||
v-if="item.iconEmoji"
|
||||
class="bookmark-emoji"
|
||||
:src="item.iconEmojiUrl"
|
||||
/>
|
||||
<div
|
||||
v-if="item.badgeGetter && getters[item.badgeGetter]"
|
||||
class="badge -dot"
|
||||
|
@ -52,6 +57,13 @@
|
|||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
|
||||
.bookmark-emoji {
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
& .bookmark-emoji,
|
||||
& .svg-inline--fa,
|
||||
& .iconLetter {
|
||||
margin: 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue