Merge branch 'customizable-post-actions' into shigusegubu-themes3
This commit is contained in:
commit
e92ecc612f
11 changed files with 57 additions and 39 deletions
|
@ -339,8 +339,6 @@ nav {
|
||||||
grid-template-areas: "content";
|
grid-template-areas: "content";
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
--_actionsColumnCount: 3;
|
|
||||||
|
|
||||||
.column {
|
.column {
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
margin: var(--navbar-height) 0 0 0;
|
margin: var(--navbar-height) 0 0 0;
|
||||||
|
|
|
@ -275,6 +275,11 @@ const Popover = {
|
||||||
this.scrollable.removeEventListener('scroll', this.onScroll)
|
this.scrollable.removeEventListener('scroll', this.onScroll)
|
||||||
this.scrollable.removeEventListener('resize', this.onResize)
|
this.scrollable.removeEventListener('resize', this.onResize)
|
||||||
},
|
},
|
||||||
|
resizePopover () {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.updateStyles()
|
||||||
|
}, 1)
|
||||||
|
},
|
||||||
onMouseenter (e) {
|
onMouseenter (e) {
|
||||||
if (this.trigger === 'hover') {
|
if (this.trigger === 'hover') {
|
||||||
this.lockReEntry = false
|
this.lockReEntry = false
|
||||||
|
@ -323,7 +328,12 @@ const Popover = {
|
||||||
this.updateStyles()
|
this.updateStyles()
|
||||||
},
|
},
|
||||||
onResize (e) {
|
onResize (e) {
|
||||||
|
const content = this.$refs.content
|
||||||
|
if (!content) return
|
||||||
|
if (this.oldSize.width !== content.offsetWidth || this.oldSize.height !== content.offsetHeight) {
|
||||||
this.updateStyles()
|
this.updateStyles()
|
||||||
|
this.oldSize = { width: content.offsetWidth, height: content.offsetHeight }
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onChildPopoverState (childRef, state) {
|
onChildPopoverState (childRef, state) {
|
||||||
if (state) {
|
if (state) {
|
||||||
|
@ -337,12 +347,7 @@ const Popover = {
|
||||||
// Monitor changes to content size, update styles only when content sizes have changed,
|
// Monitor changes to content size, update styles only when content sizes have changed,
|
||||||
// that should be the only time we need to move the popover box if we don't care about scroll
|
// that should be the only time we need to move the popover box if we don't care about scroll
|
||||||
// or resize
|
// or resize
|
||||||
const content = this.$refs.content
|
this.onResize()
|
||||||
if (!content) return
|
|
||||||
if (this.oldSize.width !== content.offsetWidth || this.oldSize.height !== content.offsetHeight) {
|
|
||||||
this.updateStyles()
|
|
||||||
this.oldSize = { width: content.offsetWidth, height: content.offsetHeight }
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.teleport = true
|
this.teleport = true
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
name="content"
|
name="content"
|
||||||
class="popover-inner"
|
class="popover-inner"
|
||||||
:close="hidePopover"
|
:close="hidePopover"
|
||||||
|
:resize="resizePopover"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
|
@ -112,11 +112,12 @@ export default {
|
||||||
this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji })
|
this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
doActionWrap (button) {
|
doActionWrap (button, close) {
|
||||||
if (button.name === 'emoji') {
|
if (button.name === 'emoji') {
|
||||||
this.$refs.picker.showPicker()
|
this.$refs.picker.showPicker()
|
||||||
} else {
|
} else {
|
||||||
this.getComponent(button) === 'button' && this.doAction(button)
|
this.getComponent(button) === 'button' && this.doAction(button)
|
||||||
|
close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,15 +3,15 @@
|
||||||
|
|
||||||
.quick-action {
|
.quick-action {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: max-content;
|
grid-template-columns: minmax(max-content, 1fr);
|
||||||
grid-gap: 0.25em;
|
grid-gap: 0.25em;
|
||||||
|
align-items: center;
|
||||||
|
height: 1.5em;
|
||||||
|
|
||||||
&.-pin {
|
.action-counter {
|
||||||
margin: calc(-2px - 0.25em);
|
overflow-x: hidden;
|
||||||
padding: 0.25em;
|
text-overflow: ellipsis;
|
||||||
border: 2px dashed var(--icon);
|
white-space: nowrap;
|
||||||
border-radius: var(--roundness);
|
|
||||||
grid-template-columns: 1fr auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-button-inner,
|
.action-button-inner,
|
||||||
|
@ -21,21 +21,30 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.separator {
|
.separator {
|
||||||
width: 0.5em;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
content: "";
|
|
||||||
display: block;
|
display: block;
|
||||||
|
align-self: stretch;
|
||||||
width: 1px;
|
width: 1px;
|
||||||
height: 1.5em;
|
|
||||||
background-color: var(--icon);
|
background-color: var(--icon);
|
||||||
|
margin-right: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.-pin {
|
||||||
|
margin: calc(-2px - 0.25em);
|
||||||
|
padding: 0.25em;
|
||||||
|
border: 2px dashed var(--icon);
|
||||||
|
border-radius: var(--roundness);
|
||||||
|
grid-template-columns: minmax(max-content, 1fr) auto;
|
||||||
|
|
||||||
|
.extra-button,
|
||||||
|
.separator {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-button-inner {
|
.action-button-inner {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-gap: 1em;
|
grid-gap: 1em;
|
||||||
grid-template-columns: max-content max-content;
|
grid-template-columns: max-content 1fr;
|
||||||
grid-auto-flow: column;
|
grid-auto-flow: column;
|
||||||
grid-auto-columns: max-content;
|
grid-auto-columns: max-content;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -45,6 +54,7 @@
|
||||||
.action-button {
|
.action-button {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-auto-flow: column;
|
grid-auto-flow: column;
|
||||||
|
align-items: center;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
.action-button-inner {
|
.action-button-inner {
|
||||||
|
|
|
@ -8,11 +8,12 @@
|
||||||
class="action-button-inner"
|
class="action-button-inner"
|
||||||
:class="buttonInnerClass"
|
:class="buttonInnerClass"
|
||||||
role="menuitem"
|
role="menuitem"
|
||||||
|
type="button"
|
||||||
|
target="_blank"
|
||||||
:tabindex="0"
|
:tabindex="0"
|
||||||
:disabled="buttonClass.disabled"
|
:disabled="buttonClass.disabled"
|
||||||
:href="getComponent(button) == 'a' ? button.link?.(funcArg) || getRemoteInteractionLink : undefined"
|
:href="getComponent(button) == 'a' ? button.link?.(funcArg) || getRemoteInteractionLink : undefined"
|
||||||
@click.prevent="doActionWrap(button)"
|
@click="doActionWrap(button, close)"
|
||||||
@click="button.name === 'emoji' ? () => {} : close()"
|
|
||||||
>
|
>
|
||||||
<FALayers>
|
<FALayers>
|
||||||
<FAIcon
|
<FAIcon
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
v-if="button.dropdown?.()"
|
v-if="button.dropdown?.()"
|
||||||
>
|
>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
{{ props }}
|
|
||||||
<ActionButton
|
<ActionButton
|
||||||
:button="button"
|
:button="button"
|
||||||
:status="status"
|
:status="status"
|
||||||
|
|
|
@ -105,6 +105,9 @@ const StatusActionButtons = {
|
||||||
.catch(err => this.$emit('onError', err.error.error))
|
.catch(err => this.$emit('onError', err.error.error))
|
||||||
.finally(() => setTimeout(() => { this.animationState[button.name] = false }))
|
.finally(() => setTimeout(() => { this.animationState[button.name] = false }))
|
||||||
},
|
},
|
||||||
|
onExtraClose () {
|
||||||
|
this.showPin = false
|
||||||
|
},
|
||||||
isPinned (button) {
|
isPinned (button) {
|
||||||
return this.pinnedItems.has(button.name)
|
return this.pinnedItems.has(button.name)
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,11 +3,17 @@
|
||||||
.StatusActionButtons {
|
.StatusActionButtons {
|
||||||
.quick-action-buttons {
|
.quick-action-buttons {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(var(--_actionsColumnCount, 6), 1fr);
|
grid-template-columns: repeat(auto-fill, 5em);
|
||||||
grid-auto-flow: row dense;
|
grid-auto-flow: row dense;
|
||||||
grid-auto-rows: 1fr;
|
grid-auto-rows: 1fr;
|
||||||
grid-gap: 1.25em 1em;
|
grid-gap: 1.25em 1em;
|
||||||
margin-top: var(--status-margin);
|
margin-top: var(--status-margin);
|
||||||
|
align-items: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pin-action-button {
|
||||||
|
margin: -0.5em;
|
||||||
|
padding: 0.5em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// popover
|
// popover
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
:get-class="getClass"
|
:get-class="getClass"
|
||||||
:get-component="getComponent"
|
:get-component="getComponent"
|
||||||
:animation-state="animationState"
|
:animation-state="animationState"
|
||||||
:close="close"
|
:close="() => {}"
|
||||||
:do-action="doAction"
|
:do-action="doAction"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
|
@ -41,10 +41,8 @@
|
||||||
:tabindex="0"
|
:tabindex="0"
|
||||||
placement="top"
|
placement="top"
|
||||||
:offset="{ y: 5 }"
|
:offset="{ y: 5 }"
|
||||||
:bound-to="{ x: 'container' }"
|
|
||||||
remove-padding
|
remove-padding
|
||||||
@show="onShow"
|
@close="onExtraClose"
|
||||||
@close="onClose"
|
|
||||||
>
|
>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<FAIcon
|
<FAIcon
|
||||||
|
@ -52,7 +50,7 @@
|
||||||
icon="ellipsis-h"
|
icon="ellipsis-h"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #content="{close}">
|
<template #content="{close, resize}">
|
||||||
<div
|
<div
|
||||||
:id="`popup-menu-${randomSeed}`"
|
:id="`popup-menu-${randomSeed}`"
|
||||||
class="dropdown-menu extra-action-buttons"
|
class="dropdown-menu extra-action-buttons"
|
||||||
|
@ -63,7 +61,7 @@
|
||||||
class="main-button"
|
class="main-button"
|
||||||
role="menuitem"
|
role="menuitem"
|
||||||
:tabindex="0"
|
:tabindex="0"
|
||||||
@click.stop="showPin = !showPin"
|
@click.stop="() => { resize(); showPin = !showPin }"
|
||||||
>
|
>
|
||||||
<FAIcon
|
<FAIcon
|
||||||
class="fa-scale-110"
|
class="fa-scale-110"
|
||||||
|
|
|
@ -292,10 +292,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#sidebar {
|
|
||||||
--_actionsColumnCount: 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar .edit-profile-button {
|
.sidebar .edit-profile-button {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue