diff --git a/src/components/popover/popover.js b/src/components/popover/popover.js
index a40a9195..dcac1958 100644
--- a/src/components/popover/popover.js
+++ b/src/components/popover/popover.js
@@ -19,11 +19,14 @@ const Popover = {
// anchor point on either axis
offset: Object,
// Additional styles you may want for the popover container
- popoverClass: String
+ popoverClass: String,
+ // Time in milliseconds until the popup appears, default is 100ms
+ delay: Number
},
data () {
return {
hidden: true,
+ hovered: false,
styles: { opacity: 0 },
oldSize: { width: 0, height: 0 }
}
@@ -110,6 +113,7 @@ const Popover = {
}
},
showPopover () {
+ if (this.trigger === 'hover' && !this.hovered) return
if (this.hidden) this.$emit('show')
this.hidden = false
this.$nextTick(this.updateStyles)
@@ -120,10 +124,16 @@ const Popover = {
this.styles = { opacity: 0 }
},
onMouseenter (e) {
- if (this.trigger === 'hover') this.showPopover()
+ if (this.trigger === 'hover') {
+ this.hovered = true
+ setTimeout(this.showPopover, this.delay || 100)
+ }
},
onMouseleave (e) {
- if (this.trigger === 'hover') this.hidePopover()
+ if (this.trigger === 'hover') {
+ this.hovered = false
+ this.hidePopover()
+ }
},
onClick (e) {
if (this.trigger === 'click') {
diff --git a/src/components/status/status.js b/src/components/status/status.js
index ad0b72a9..22a4dd50 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -9,6 +9,7 @@ import AvatarList from '../avatar_list/avatar_list.vue'
import Timeago from '../timeago/timeago.vue'
import StatusContent from '../status_content/status_content.vue'
import StatusPopover from '../status_popover/status_popover.vue'
+import UserPopover from '../user_popover/user_popover.vue'
import EmojiReactions from '../emoji_reactions/emoji_reactions.vue'
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
@@ -37,7 +38,6 @@ const Status = {
return {
replying: false,
unmuted: false,
- userExpanded: false,
error: null
}
},
@@ -203,13 +203,13 @@ const Status = {
RetweetButton,
ExtraButtons,
PostStatusForm,
- UserCard,
UserAvatar,
AvatarList,
Timeago,
StatusPopover,
EmojiReactions,
- StatusContent
+ StatusContent,
+ UserPopover
},
methods: {
visibilityIcon (visibility) {
@@ -244,9 +244,6 @@ const Status = {
toggleMute () {
this.unmuted = !this.unmuted
},
- toggleUserExpanded () {
- this.userExpanded = !this.userExpanded
- },
generateUserProfileLink (id, name) {
return generateProfileLink(id, name, this.$store.state.instance.restrictedNicknames)
}
diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index f6b5dd6f..2d74e5d6 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -22,9 +22,11 @@
v-if="muted && retweet"
class="button-icon icon-retweet"
/>
-
- {{ status.user.screen_name }}
-
+
+
+ {{ status.user.screen_name }}
+
+
-
- {{ retweeter }}
+
+
+ {{ retweeter }}
+
-
{{ status.user.name }}
-
- {{ status.user.screen_name }}
-
+
+
+ {{ status.user.screen_name }}
+
+
@@ -222,9 +218,11 @@
>
{{ $t('status.reply_to') }}
-
- {{ replyToName }}
-
+
+
+ {{ replyToName }}
+
+
+
+
+
diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js
index 8e6b9d7f..5f66f036 100644
--- a/src/components/user_card/user_card.js
+++ b/src/components/user_card/user_card.js
@@ -9,7 +9,13 @@ import { mapGetters } from 'vuex'
export default {
props: [
- 'userId', 'switcher', 'selected', 'hideBio', 'rounded', 'bordered', 'allowZoomingAvatar'
+ 'userId',
+ 'switcher',
+ 'selected',
+ 'hideBio',
+ 'rounded',
+ 'bordered',
+ 'allowZoomingAvatar'
],
data () {
return {
diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
index 9529d7f6..5f7861b2 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -19,6 +19,7 @@
@@ -31,6 +32,7 @@
diff --git a/src/components/user_popover/user_popover.js b/src/components/user_popover/user_popover.js
new file mode 100644
index 00000000..b9143b89
--- /dev/null
+++ b/src/components/user_popover/user_popover.js
@@ -0,0 +1,35 @@
+
+const UserPopover = {
+ name: 'UserPopover',
+ props: [
+ 'userId'
+ ],
+ data () {
+ return {
+ error: false
+ }
+ },
+ computed: {
+ user () {
+ return this.$store.getters.findUser(this.userId)
+ }
+ },
+ components: {
+ Popover: () => import('../popover/popover.vue'),
+ UserCard: () => import('../user_card/user_card.vue')
+ },
+ methods: {
+ enter () {
+ if (!this.user) {
+ if (!this.userId) {
+ return
+ }
+ this.$store.dispatch('fetchUser', this.userId)
+ .then(data => (this.error = false))
+ .catch(e => (this.error = true))
+ }
+ }
+ }
+}
+
+export default UserPopover
diff --git a/src/components/user_popover/user_popover.vue b/src/components/user_popover/user_popover.vue
new file mode 100644
index 00000000..f0d91de0
--- /dev/null
+++ b/src/components/user_popover/user_popover.vue
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+ {{ $t('status.status_unavailable') }}
+
+
+
+
+
+
+
+
+
+
+