aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authortusooa <tusooa@kazv.moe>2023-01-15 10:00:44 -0500
committertusooa <tusooa@kazv.moe>2023-01-15 10:00:44 -0500
commitd2ba67d565ba68acc1938dc9ae2c866a6e39d4d6 (patch)
tree1dad722edc84b5ba1759a13e1944167c5ffcf7c3 /src/components
parenta28032fa58ff341b8815a0651d621ed358efd168 (diff)
parent4d2056d8aaa8f2c20a3275503857d38ac9112e5f (diff)
Merge remote-tracking branch 'upstream/develop' into tusooa/stylelint
Diffstat (limited to 'src/components')
-rw-r--r--src/components/attachment/attachment.js4
-rw-r--r--src/components/attachment/attachment.scss6
-rw-r--r--src/components/attachment/attachment.vue5
-rw-r--r--src/components/desktop_nav/desktop_nav.vue4
-rw-r--r--src/components/emoji_picker/emoji_picker.js2
-rw-r--r--src/components/emoji_picker/emoji_picker.scss2
-rw-r--r--src/components/emoji_picker/emoji_picker.vue1
-rw-r--r--src/components/gallery/gallery.js1
-rw-r--r--src/components/gallery/gallery.vue1
-rw-r--r--src/components/media_modal/media_modal.js5
-rw-r--r--src/components/media_modal/media_modal.vue1
-rw-r--r--src/components/react_button/react_button.js2
-rw-r--r--src/components/settings_modal/tabs/filtering_tab.js9
-rw-r--r--src/components/settings_modal/tabs/profile_tab.js2
-rw-r--r--src/components/status/status.vue4
-rw-r--r--src/components/status_content/status_content.vue1
-rw-r--r--src/components/swipe_click/swipe_click.js7
17 files changed, 44 insertions, 13 deletions
diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js
index 5dc50475..6e14b24d 100644
--- a/src/components/attachment/attachment.js
+++ b/src/components/attachment/attachment.js
@@ -36,6 +36,7 @@ library.add(
const Attachment = {
props: [
'attachment',
+ 'compact',
'description',
'hideDescription',
'nsfw',
@@ -71,7 +72,8 @@ const Attachment = {
{
'-loading': this.loading,
'-nsfw-placeholder': this.hidden,
- '-editable': this.edit !== undefined
+ '-editable': this.edit !== undefined,
+ '-compact': this.compact
},
'-type-' + this.type,
this.size && '-size-' + this.size,
diff --git a/src/components/attachment/attachment.scss b/src/components/attachment/attachment.scss
index cf38d45b..681bab29 100644
--- a/src/components/attachment/attachment.scss
+++ b/src/components/attachment/attachment.scss
@@ -266,4 +266,10 @@
&.-loading {
cursor: progress;
}
+
+ &.-compact {
+ .placeholder-container {
+ padding-bottom: 0.5em;
+ }
+ }
}
diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue
index 2a89886d..79f62806 100644
--- a/src/components/attachment/attachment.vue
+++ b/src/components/attachment/attachment.vue
@@ -162,10 +162,11 @@
target="_blank"
>
<FAIcon
- size="5x"
+ :size="compact ? '2x' : '5x'"
:icon="placeholderIconClass"
+ :title="localDescription"
/>
- <p>
+ <p v-if="!compact">
{{ localDescription }}
</p>
</a>
diff --git a/src/components/desktop_nav/desktop_nav.vue b/src/components/desktop_nav/desktop_nav.vue
index 5db7fc79..07bf8005 100644
--- a/src/components/desktop_nav/desktop_nav.vue
+++ b/src/components/desktop_nav/desktop_nav.vue
@@ -38,7 +38,7 @@
/>
<button
class="button-unstyled nav-icon"
- @click="openSettingsModal"
+ @click.stop="openSettingsModal"
>
<FAIcon
fixed-width
@@ -65,7 +65,7 @@
<button
v-if="currentUser"
class="button-unstyled nav-icon"
- @click.prevent="logout"
+ @click.stop.prevent="logout"
>
<FAIcon
fixed-width
diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js
index 4a447905..0d7ca812 100644
--- a/src/components/emoji_picker/emoji_picker.js
+++ b/src/components/emoji_picker/emoji_picker.js
@@ -244,7 +244,7 @@ const EmojiPicker = {
if (!this.$refs['emoji-groups']) {
return
}
- this.width = this.$refs['emoji-groups'].$el.offsetWidth
+ this.width = this.$refs['emoji-groups'].$el.clientWidth
})
}
},
diff --git a/src/components/emoji_picker/emoji_picker.scss b/src/components/emoji_picker/emoji_picker.scss
index 0ec261a4..5bcff33b 100644
--- a/src/components/emoji_picker/emoji_picker.scss
+++ b/src/components/emoji_picker/emoji_picker.scss
@@ -7,7 +7,7 @@ $emoji-picker-emoji-size: 32px;
.emoji-picker {
width: 25em;
- max-width: 100vw;
+ max-width: calc(100vw - 20px); // popover gives 10px margin from window edge
display: flex;
flex-direction: column;
background-color: $fallback--bg;
diff --git a/src/components/emoji_picker/emoji_picker.vue b/src/components/emoji_picker/emoji_picker.vue
index 453ecdfc..ca90bf26 100644
--- a/src/components/emoji_picker/emoji_picker.vue
+++ b/src/components/emoji_picker/emoji_picker.vue
@@ -83,6 +83,7 @@
:emit-update="true"
@update="onScroll"
@visible="recalculateItemPerRow"
+ @resize="recalculateItemPerRow"
>
<template #default="{ item: group, index, active }">
<DynamicScrollerItem
diff --git a/src/components/gallery/gallery.js b/src/components/gallery/gallery.js
index 4e1bda55..e86a3eea 100644
--- a/src/components/gallery/gallery.js
+++ b/src/components/gallery/gallery.js
@@ -4,6 +4,7 @@ import { sumBy, set } from 'lodash'
const Gallery = {
props: [
'attachments',
+ 'compact',
'limitRows',
'descriptions',
'limit',
diff --git a/src/components/gallery/gallery.vue b/src/components/gallery/gallery.vue
index 744b8198..96b554e3 100644
--- a/src/components/gallery/gallery.vue
+++ b/src/components/gallery/gallery.vue
@@ -20,6 +20,7 @@
v-for="(attachment, attachmentIndex) in row.items"
:key="attachment.id"
class="gallery-item"
+ :compact="compact"
:nsfw="nsfw"
:attachment="attachment"
:size="size"
diff --git a/src/components/media_modal/media_modal.js b/src/components/media_modal/media_modal.js
index ff993664..05ef9fbe 100644
--- a/src/components/media_modal/media_modal.js
+++ b/src/components/media_modal/media_modal.js
@@ -63,6 +63,11 @@ const MediaModal = {
},
type () {
return this.currentMedia ? this.getType(this.currentMedia) : null
+ },
+ swipeDisableClickThreshold () {
+ // If there is only one media, allow more mouse movements to close the modal
+ // because there is less chance that the user wants to switch to another image
+ return () => this.canNavigate ? 1 : 30
}
},
methods: {
diff --git a/src/components/media_modal/media_modal.vue b/src/components/media_modal/media_modal.vue
index 6464b99f..eb28f8be 100644
--- a/src/components/media_modal/media_modal.vue
+++ b/src/components/media_modal/media_modal.vue
@@ -10,6 +10,7 @@
class="modal-image-container"
:direction="swipeDirection"
:threshold="swipeThreshold"
+ :disable-click-threshold="swipeDisableClickThreshold"
@preview-requested="handleSwipePreview"
@swipe-finished="handleSwipeEnd"
@swipeless-clicked="hide"
diff --git a/src/components/react_button/react_button.js b/src/components/react_button/react_button.js
index 2a0dac85..47a48623 100644
--- a/src/components/react_button/react_button.js
+++ b/src/components/react_button/react_button.js
@@ -41,7 +41,7 @@ const ReactButton = {
},
focusInput () {
this.$nextTick(() => {
- const input = this.$el.querySelector('input')
+ const input = document.querySelector('.reaction-picker-filter > input')
if (input) input.focus()
})
},
diff --git a/src/components/settings_modal/tabs/filtering_tab.js b/src/components/settings_modal/tabs/filtering_tab.js
index 5354e5db..7c37f0bc 100644
--- a/src/components/settings_modal/tabs/filtering_tab.js
+++ b/src/components/settings_modal/tabs/filtering_tab.js
@@ -1,4 +1,4 @@
-import { filter, trim } from 'lodash'
+import { filter, trim, debounce } from 'lodash'
import BooleanSetting from '../helpers/boolean_setting.vue'
import ChoiceSetting from '../helpers/choice_setting.vue'
import IntegerSetting from '../helpers/integer_setting.vue'
@@ -29,11 +29,16 @@ const FilteringTab = {
},
set (value) {
this.muteWordsStringLocal = value
+ this.debouncedSetMuteWords(value)
+ }
+ },
+ debouncedSetMuteWords () {
+ return debounce((value) => {
this.$store.dispatch('setOption', {
name: 'muteWords',
value: filter(value.split('\n'), (word) => trim(word).length > 0)
})
- }
+ }, 1000)
}
},
// Updating nested properties
diff --git a/src/components/settings_modal/tabs/profile_tab.js b/src/components/settings_modal/tabs/profile_tab.js
index b86faef0..ff2ccef2 100644
--- a/src/components/settings_modal/tabs/profile_tab.js
+++ b/src/components/settings_modal/tabs/profile_tab.js
@@ -153,7 +153,7 @@ const ProfileTab = {
return false
},
deleteField (index, event) {
- this.$delete(this.newFields, index)
+ this.newFields.splice(index, 1)
},
uploadFile (slot, e) {
const file = e.target.files[0]
diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index fe8778cf..35b15362 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -84,7 +84,7 @@
:user="statusoid.user"
/>
<div class="right-side faint">
- <span
+ <bdi
class="status-username repeater-name"
:title="retweeter"
>
@@ -101,7 +101,7 @@
v-else
:to="retweeterProfileLink"
>{{ retweeter }}</router-link>
- </span>
+ </bdi>
{{ ' ' }}
<FAIcon
icon="retweet"
diff --git a/src/components/status_content/status_content.vue b/src/components/status_content/status_content.vue
index e2120f7a..c0e5c0b9 100644
--- a/src/components/status_content/status_content.vue
+++ b/src/components/status_content/status_content.vue
@@ -33,6 +33,7 @@
<gallery
v-if="status.attachments.length !== 0"
class="attachments media-body"
+ :compact="compact"
:nsfw="nsfwClickthrough"
:attachments="status.attachments"
:limit="compact ? 1 : 0"
diff --git a/src/components/swipe_click/swipe_click.js b/src/components/swipe_click/swipe_click.js
index 238e6df8..2a423901 100644
--- a/src/components/swipe_click/swipe_click.js
+++ b/src/components/swipe_click/swipe_click.js
@@ -5,6 +5,8 @@ import GestureService from '../../services/gesture_service/gesture_service'
* direction: a vector that indicates the direction of the intended swipe
* threshold: the minimum distance in pixels the swipe has moved on `direction'
* for swipe-finished() to have a non-zero sign
+ * disableClickThreshold: the minimum distance in pixels for the swipe to
+ * not trigger a click
* perpendicularTolerance: see gesture_service
*
* Events:
@@ -34,6 +36,10 @@ const SwipeClick = {
type: Function,
default: () => 30
},
+ disableClickThreshold: {
+ type: Function,
+ default: () => 1
+ },
perpendicularTolerance: {
type: Number,
default: 1.0
@@ -72,6 +78,7 @@ const SwipeClick = {
this.$gesture = new GestureService.SwipeAndClickGesture({
direction: this.direction,
threshold: this.threshold,
+ disableClickThreshold: this.disableClickThreshold,
perpendicularTolerance: this.perpendicularTolerance,
swipePreviewCallback: this.preview,
swipeEndCallback: this.end,