diff --git a/src/App.scss b/src/App.scss index 1b781304e..081ce2fdb 100644 --- a/src/App.scss +++ b/src/App.scss @@ -339,6 +339,8 @@ nav { grid-template-areas: "content"; padding: 0; + --_actionsColumnCount: 3; + .column { padding-top: 0; margin: var(--navbar-height) 0 0 0; diff --git a/src/components/popover/popover.js b/src/components/popover/popover.js index 242068109..6b49cf682 100644 --- a/src/components/popover/popover.js +++ b/src/components/popover/popover.js @@ -275,11 +275,6 @@ const Popover = { this.scrollable.removeEventListener('scroll', this.onScroll) this.scrollable.removeEventListener('resize', this.onResize) }, - resizePopover () { - setTimeout(() => { - this.updateStyles() - }, 1) - }, onMouseenter (e) { if (this.trigger === 'hover') { this.lockReEntry = false @@ -328,12 +323,7 @@ const Popover = { this.updateStyles() }, onResize (e) { - const content = this.$refs.content - if (!content) return - if (this.oldSize.width !== content.offsetWidth || this.oldSize.height !== content.offsetHeight) { - this.updateStyles() - this.oldSize = { width: content.offsetWidth, height: content.offsetHeight } - } + this.updateStyles() }, onChildPopoverState (childRef, state) { if (state) { @@ -347,7 +337,12 @@ const Popover = { // 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 // or resize - this.onResize() + const content = this.$refs.content + 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 () { this.teleport = true diff --git a/src/components/popover/popover.vue b/src/components/popover/popover.vue index f91abc3f0..33817fa6a 100644 --- a/src/components/popover/popover.vue +++ b/src/components/popover/popover.vue @@ -33,7 +33,6 @@ name="content" class="popover-inner" :close="hidePopover" - :resize="resizePopover" /> diff --git a/src/components/status_action_buttons/action_button.js b/src/components/status_action_buttons/action_button.js index 193a96ee9..b87e07687 100644 --- a/src/components/status_action_buttons/action_button.js +++ b/src/components/status_action_buttons/action_button.js @@ -112,12 +112,11 @@ export default { this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji }) } }, - doActionWrap (button, close) { + doActionWrap (button) { if (button.name === 'emoji') { this.$refs.picker.showPicker() } else { this.getComponent(button) === 'button' && this.doAction(button) - close() } } } diff --git a/src/components/status_action_buttons/action_button.scss b/src/components/status_action_buttons/action_button.scss index 14bfdfa9d..fe4983946 100644 --- a/src/components/status_action_buttons/action_button.scss +++ b/src/components/status_action_buttons/action_button.scss @@ -3,15 +3,15 @@ .quick-action { display: grid; - grid-template-columns: minmax(max-content, 1fr); + grid-template-columns: max-content; grid-gap: 0.25em; - align-items: center; - height: 1.5em; - .action-counter { - overflow-x: hidden; - text-overflow: ellipsis; - white-space: nowrap; + &.-pin { + margin: calc(-2px - 0.25em); + padding: 0.25em; + border: 2px dashed var(--icon); + border-radius: var(--roundness); + grid-template-columns: 1fr auto; } .action-button-inner, @@ -21,30 +21,21 @@ } .separator { - display: block; - align-self: stretch; - width: 1px; - background-color: var(--icon); - margin-right: 0.5em; - } + width: 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; + &::before { + content: ""; + display: block; + width: 1px; + height: 1.5em; + background-color: var(--icon); } } .action-button-inner { display: grid; grid-gap: 1em; - grid-template-columns: max-content 1fr; + grid-template-columns: max-content max-content; grid-auto-flow: column; grid-auto-columns: max-content; align-items: center; @@ -54,7 +45,6 @@ .action-button { display: grid; grid-auto-flow: column; - align-items: center; padding: 0; .action-button-inner { diff --git a/src/components/status_action_buttons/action_button.vue b/src/components/status_action_buttons/action_button.vue index b9dca8818..40d3397c5 100644 --- a/src/components/status_action_buttons/action_button.vue +++ b/src/components/status_action_buttons/action_button.vue @@ -8,12 +8,11 @@ class="action-button-inner" :class="buttonInnerClass" role="menuitem" - type="button" - target="_blank" :tabindex="0" :disabled="buttonClass.disabled" :href="getComponent(button) == 'a' ? button.link?.(funcArg) || getRemoteInteractionLink : undefined" - @click="doActionWrap(button, close)" + @click.prevent="doActionWrap(button)" + @click="button.name === 'emoji' ? () => {} : close()" >