From f4b18df644907090516bf19c8f6c7b78e0b2bb43 Mon Sep 17 00:00:00 2001
From: Shpuld Shpuldson <shp@cock.li>
Date: Wed, 2 Dec 2020 16:07:31 +0200
Subject: block clicks in blank area of timeline menu, fix 'up-to-date' align

---
 src/components/timeline_menu/timeline_menu.vue | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

(limited to 'src/components/timeline_menu/timeline_menu.vue')

diff --git a/src/components/timeline_menu/timeline_menu.vue b/src/components/timeline_menu/timeline_menu.vue
index c46531be..dd8dbf34 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"
     >
-      <span>{{ timelineName() }}</span>
-      <FAIcon
-        size="sm"
-        icon="chevron-down"
-      />
+      <span class="timeline-title">{{ timelineName() }}</span>
+      <span>
+        <FAIcon
+          size="sm"
+          icon="chevron-down"
+        />
+      </span>
+      <span class="click-blocker" />
     </div>
   </Popover>
 </template>
@@ -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 {
-- 
cgit v1.2.3-70-g09d2


From fa01030641de7be89206787f5e364318086e8524 Mon Sep 17 00:00:00 2001
From: Shpuld Shpuldson <shp@cock.li>
Date: Thu, 3 Dec 2020 10:07:42 +0200
Subject: 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(-)

(limited to 'src/components/timeline_menu/timeline_menu.vue')

diff --git a/src/components/timeline_menu/timeline_menu.js b/src/components/timeline_menu/timeline_menu.js
index ef8a5813..8d6a58b1 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 dd8dbf34..3c86842b 100644
--- a/src/components/timeline_menu/timeline_menu.vue
+++ b/src/components/timeline_menu/timeline_menu.vue
@@ -72,7 +72,10 @@
           icon="chevron-down"
         />
       </span>
-      <span class="click-blocker" />
+      <span
+        class="click-blocker"
+        @click="blockOpen"
+      />
     </div>
   </Popover>
 </template>
@@ -135,7 +138,6 @@
 
     .click-blocker {
       cursor: default;
-      pointer-events: none;
       flex-grow: 1;
     }
   }
-- 
cgit v1.2.3-70-g09d2

