From f4b18df644907090516bf19c8f6c7b78e0b2bb43 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Wed, 2 Dec 2020 16:07:31 +0200 Subject: [PATCH 1/2] block clicks in blank area of timeline menu, fix 'up-to-date' align --- CHANGELOG.md | 1 + src/components/timeline/timeline.vue | 1 + .../timeline_menu/timeline_menu.vue | 22 ++++++++++++++----- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e424a6285..c39809ee8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - Errors when fetching are now shown with popup errors instead of "Error fetching updates" in panel headers - Made reply/fav/repeat etc buttons easier to hit +- Adjusted timeline menu clickable area to match the visible button ## [2.2.1] - 2020-11-11 diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue index 0326342be4..4c43fe5ce8 100644 --- a/src/components/timeline/timeline.vue +++ b/src/components/timeline/timeline.vue @@ -102,6 +102,7 @@ .timeline-heading { max-width: 100%; flex-wrap: nowrap; + align-items: center; .loadmore-button { flex-shrink: 0; } diff --git a/src/components/timeline_menu/timeline_menu.vue b/src/components/timeline_menu/timeline_menu.vue index c46531be47..dd8dbf34ce 100644 --- a/src/components/timeline_menu/timeline_menu.vue +++ b/src/components/timeline_menu/timeline_menu.vue @@ -65,11 +65,14 @@ slot="trigger" class="title timeline-menu-title" > - {{ timelineName() }} - + {{ timelineName() }} + + + + @@ -117,8 +120,9 @@ cursor: pointer; user-select: none; width: 100%; + display: flex; - span { + .timeline-menu-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; @@ -128,6 +132,12 @@ margin-left: 0.6em; transition: transform 100ms; } + + .click-blocker { + cursor: default; + pointer-events: none; + flex-grow: 1; + } } &.open .timeline-menu-title svg { From fa01030641de7be89206787f5e364318086e8524 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Thu, 3 Dec 2020 10:07:42 +0200 Subject: [PATCH 2/2] make click blocking actually work --- src/components/timeline_menu/timeline_menu.js | 8 ++++++++ src/components/timeline_menu/timeline_menu.vue | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/timeline_menu/timeline_menu.js b/src/components/timeline_menu/timeline_menu.js index ef8a581379..8d6a58b11e 100644 --- a/src/components/timeline_menu/timeline_menu.js +++ b/src/components/timeline_menu/timeline_menu.js @@ -59,6 +59,14 @@ const TimelineMenu = { this.isOpen = true }, 25) }, + blockOpen (event) { + // For the blank area inside the button element. + // Just setting @click.stop="" makes unintuitive behavior when + // menu is open and clicking on the blank area doesn't close it. + if (!this.isOpen) { + event.stopPropagation() + } + }, timelineName () { const route = this.$route.name if (route === 'tag-timeline') { diff --git a/src/components/timeline_menu/timeline_menu.vue b/src/components/timeline_menu/timeline_menu.vue index dd8dbf34ce..3c86842b7d 100644 --- a/src/components/timeline_menu/timeline_menu.vue +++ b/src/components/timeline_menu/timeline_menu.vue @@ -72,7 +72,10 @@ icon="chevron-down" /> - + @@ -135,7 +138,6 @@ .click-blocker { cursor: default; - pointer-events: none; flex-grow: 1; } }