improvements for bookmark button
This commit is contained in:
parent
8912664ab3
commit
7bab1e4259
7 changed files with 27 additions and 10 deletions
|
@ -54,6 +54,7 @@
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
grid-auto-flow: column;
|
grid-auto-flow: column;
|
||||||
grid-auto-columns: auto;
|
grid-auto-columns: auto;
|
||||||
|
grid-gap: 0.5em;
|
||||||
|
|
||||||
.popover-wrapper {
|
.popover-wrapper {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
|
@ -65,7 +65,7 @@ export default {
|
||||||
'getClass',
|
'getClass',
|
||||||
'getComponent',
|
'getComponent',
|
||||||
'doAction',
|
'doAction',
|
||||||
'close'
|
'outerClose'
|
||||||
],
|
],
|
||||||
components: {
|
components: {
|
||||||
StatusBookmarkFolderMenu,
|
StatusBookmarkFolderMenu,
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
:tabindex="0"
|
:tabindex="0"
|
||||||
:disabled="buttonClass.disabled"
|
:disabled="buttonClass.disabled"
|
||||||
:href="getComponent(button) == 'a' ? button.link?.(funcArg) || remoteInteractionLink : undefined"
|
:href="getComponent(button) == 'a' ? button.link?.(funcArg) || remoteInteractionLink : undefined"
|
||||||
@click="doActionWrap(button, close)"
|
@click="doActionWrap(button, outerClose)"
|
||||||
>
|
>
|
||||||
<FALayers>
|
<FALayers>
|
||||||
<FAIcon
|
<FAIcon
|
||||||
|
@ -84,10 +84,11 @@
|
||||||
fixed-width
|
fixed-width
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #content>
|
<template #content="{close}">
|
||||||
<StatusBookmarkFolderMenu
|
<StatusBookmarkFolderMenu
|
||||||
v-if="button.name === 'bookmark'"
|
v-if="button.name === 'bookmark'"
|
||||||
:status="status"
|
:status="status"
|
||||||
|
:close="() => { close(); outerClose() }"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</Popover>
|
</Popover>
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
:func-arg="funcArg"
|
:func-arg="funcArg"
|
||||||
:get-class="getClass"
|
:get-class="getClass"
|
||||||
:get-component="getComponent"
|
:get-component="getComponent"
|
||||||
:close="close"
|
:outerClose="close"
|
||||||
:do-action="doAction"
|
:do-action="doAction"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
|
|
|
@ -2,19 +2,22 @@ import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import { faChevronRight, faFolder } from '@fortawesome/free-solid-svg-icons'
|
import { faChevronRight, faFolder } from '@fortawesome/free-solid-svg-icons'
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
import Popover from '../popover/popover.vue'
|
import Popover from 'src/components/popover/popover.vue'
|
||||||
|
import StillImage from 'src/components/still-image/still-image.vue'
|
||||||
|
|
||||||
library.add(faChevronRight, faFolder)
|
library.add(faChevronRight, faFolder)
|
||||||
|
|
||||||
const StatusBookmarkFolderMenu = {
|
const StatusBookmarkFolderMenu = {
|
||||||
props: [
|
props: [
|
||||||
'status'
|
'status',
|
||||||
|
'close'
|
||||||
],
|
],
|
||||||
data () {
|
data () {
|
||||||
return {}
|
return {}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Popover
|
Popover,
|
||||||
|
StillImage
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
.bookmark-folder-menu {
|
||||||
|
--__horizontal-gap: 0.5em;
|
||||||
|
--_still-image-label-visibility: hidden;
|
||||||
|
|
||||||
|
.emoji {
|
||||||
|
width: var(--__line-height);
|
||||||
|
height: var(--__line-height);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,22 +1,25 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu bookmark-folder-menu">
|
||||||
<div
|
<div
|
||||||
v-for="folder in folders"
|
v-for="folder in folders"
|
||||||
:key="folder.id"
|
:key="folder.id"
|
||||||
class="menu-item dropdown-item -icon"
|
class="menu-item dropdown-item -icon-double"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="main-button"
|
class="main-button"
|
||||||
@click="toggleFolder(folder.id)"
|
@click="toggleFolder(folder.id)"
|
||||||
|
@click.stop="close"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="input menu-checkbox -radio"
|
class="input menu-checkbox -radio"
|
||||||
:class="{ 'menu-checkbox-checked': status.bookmark_folder_id == folder.id }"
|
:class="{ 'menu-checkbox-checked': status.bookmark_folder_id == folder.id }"
|
||||||
/>
|
/>
|
||||||
{{ folder.name }}
|
<StillImage :src="folder.emoji_url" class="emoji" />
|
||||||
|
{{ ' ' + folder.name }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script src="./status_bookmark_folder_menu.js"></script>
|
<script src="./status_bookmark_folder_menu.js"></script>
|
||||||
|
<stlye src="./status_bookmark_folder_menu.scss" />
|
||||||
|
|
Loading…
Add table
Reference in a new issue