Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pleroma-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
pleroma-fe
Commits
7dfcabb5
Commit
7dfcabb5
authored
5 years ago
by
Tae Hoon
Browse files
Options
Downloads
Patches
Plain Diff
sync profile tab state with location query
parent
e8c22fbf
No related branches found
No related tags found
2 merge requests
!1028
`master` refresh with `develop`
,
!914
Restore scroll position for user profile when navigate back and forward
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/user_profile/user_profile.js
+11
-3
11 additions, 3 deletions
src/components/user_profile/user_profile.js
src/components/user_profile/user_profile.vue
+17
-12
17 additions, 12 deletions
src/components/user_profile/user_profile.vue
with
28 additions
and
15 deletions
src/components/user_profile/user_profile.js
+
11
−
3
View file @
7dfcabb5
...
...
@@ -22,16 +22,20 @@ const FriendList = withLoadMore({
additionalPropNames
:
[
'
userId
'
]
})(
List
)
const
defaultTabKey
=
'
statuses
'
const
UserProfile
=
{
data
()
{
return
{
error
:
false
,
userId
:
null
userId
:
null
,
tab
:
defaultTabKey
}
},
created
()
{
const
routeParams
=
this
.
$route
.
params
this
.
load
(
routeParams
.
name
||
routeParams
.
id
)
this
.
tab
=
get
(
this
.
$route
,
'
query.tab
'
,
defaultTabKey
)
},
destroyed
()
{
this
.
stopFetching
()
...
...
@@ -115,6 +119,10 @@ const UserProfile = {
switchUser
(
userNameOrId
)
{
this
.
stopFetching
()
this
.
load
(
userNameOrId
)
},
onTabSwitch
(
tab
)
{
this
.
tab
=
tab
this
.
$router
.
replace
({
query
:
{
tab
}
})
}
},
watch
:
{
...
...
@@ -128,8 +136,8 @@ const UserProfile = {
this
.
switchUser
(
newVal
)
}
},
$route
(
)
{
this
.
$refs
.
tabSwitcher
.
activateTab
(
0
)()
'
$route
.query
'
:
function
(
newVal
)
{
this
.
tab
=
newVal
.
tab
||
defaultTabKey
}
},
components
:
{
...
...
This diff is collapsed.
Click to expand it.
src/components/user_profile/user_profile.vue
+
17
−
12
View file @
7dfcabb5
...
...
@@ -12,22 +12,24 @@
rounded=
"top"
/>
<tab-switcher
ref=
"tabSwitcher
"
:active-tab=
"tab
"
:render-only-focused=
"true"
:on-switch=
"onTabSwitch"
>
<
div
:label=
"$t('user_card.statuses')"
>
<Timeline
:count=
"user
.statuses
_count
"
:embedded=
"true
"
:title=
"$t('user_profile.timeline_title')
"
:ti
meline=
"timeline
"
timeline
-name=
"user
"
:user-id
=
"user
Id
"
:pinned-status
-id
s
=
"user
.pinnedStatus
Id
s
"
/>
</div
>
<
Timeline
key=
"statuses"
:label=
"$t('user_card
.statuses
')
"
:count=
"user.statuses_count
"
:embedded=
"true
"
:ti
tle=
"$t('user_profile.timeline_title')
"
:
timeline
=
"timeline
"
timeline-name
=
"user"
:user
-id=
"userId"
:pinned-status-ids=
"user.pinnedStatusIds"
/
>
<div
v-if=
"followsTabVisible"
key=
"followees"
:label=
"$t('user_card.followees')"
:disabled=
"!user.friends_count"
>
...
...
@@ -42,6 +44,7 @@
</div>
<div
v-if=
"followersTabVisible"
key=
"followers"
:label=
"$t('user_card.followers')"
:disabled=
"!user.followers_count"
>
...
...
@@ -58,6 +61,7 @@
</FollowerList>
</div>
<Timeline
key=
"media"
:label=
"$t('user_card.media')"
:disabled=
"!media.visibleStatuses.length"
:embedded=
"true"
...
...
@@ -68,6 +72,7 @@
/>
<Timeline
v-if=
"isUs"
key=
"favorites"
:label=
"$t('user_card.favorites')"
:disabled=
"!favorites.visibleStatuses.length"
:embedded=
"true"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment