Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
Service Desk
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
Paul Walko
funkwhale
Commits
d726a959
Verified
Commit
d726a959
authored
7 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Fix #131: Removed player from queue tab and consistently show current track in queue
parent
ae651903
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/changelog.d/131.enhancement
+1
-0
1 addition, 0 deletions
changes/changelog.d/131.enhancement
front/src/components/Sidebar.vue
+50
-7
50 additions, 7 deletions
front/src/components/Sidebar.vue
with
51 additions
and
7 deletions
changes/changelog.d/131.enhancement
0 → 100644
+
1
−
0
View file @
d726a959
Removed player from queue tab and consistently show current track in queue (#131)
This diff is collapsed.
Click to expand it.
front/src/components/Sidebar.vue
+
50
−
7
View file @
d726a959
...
...
@@ -16,8 +16,8 @@
<div
class=
"menu-area"
>
<div
class=
"ui compact fluid two item inverted menu"
>
<a
class=
"active item"
data-tab=
"library"
>
Browse
</a>
<a
class=
"item"
data-tab=
"queue"
>
<a
class=
"active item"
@
click=
"selectedTab = 'library'"
data-tab=
"library"
>
Browse
</a>
<a
class=
"item"
@
click=
"selectedTab = 'queue'"
data-tab=
"queue"
>
Queue
<template
v-if=
"queue.tracks.length === 0"
>
(empty)
...
...
@@ -46,6 +46,8 @@
v-if=
"$store.state.auth.authenticated"
class=
"item"
:to=
"{path: '/activity'}"
><i
class=
"bell icon"
></i>
Activity
</router-link>
</div>
<player></player>
</div>
<div
v-if=
"queue.previousQueue "
class=
"ui black icon message"
>
<i
class=
"history icon"
></i>
...
...
@@ -96,7 +98,6 @@
</div>
</div>
</div>
<player></player>
</div>
</template>
...
...
@@ -121,6 +122,7 @@ export default {
},
data
()
{
return
{
selectedTab
:
'
library
'
,
backend
:
backend
,
isCollapsed
:
true
}
...
...
@@ -140,11 +142,36 @@ export default {
}),
reorder
:
function
(
oldValue
,
newValue
)
{
this
.
$store
.
commit
(
'
queue/reorder
'
,
{
oldValue
,
newValue
})
},
scrollToCurrent
()
{
let
current
=
$
(
this
.
$el
).
find
(
'
[data-tab="queue"] .active
'
)[
0
]
if
(
!
current
)
{
return
}
let
container
=
$
(
this
.
$el
).
find
(
'
.tabs
'
)[
0
]
// Position container at the top line then scroll current into view
container
.
scrollTop
=
0
current
.
scrollIntoView
(
true
)
// Scroll back nothing if element is at bottom of container else do it
// for half the height of the containers display area
var
scrollBack
=
(
container
.
scrollHeight
-
container
.
scrollTop
<=
container
.
clientHeight
)
?
0
:
container
.
clientHeight
/
2
container
.
scrollTop
=
container
.
scrollTop
-
scrollBack
console
.
log
(
container
.
scrollHeight
-
container
.
scrollTop
,
container
.
clientHeight
)
}
},
watch
:
{
url
:
function
()
{
this
.
isCollapsed
=
true
},
selectedTab
:
function
(
newValue
)
{
if
(
newValue
===
'
queue
'
)
{
this
.
scrollToCurrent
()
}
},
'
$store.state.queue.currentIndex
'
:
function
()
{
if
(
this
.
selectedTab
!==
'
queue
'
)
{
this
.
scrollToCurrent
()
}
}
}
}
...
...
@@ -204,19 +231,38 @@ $sidebar-color: #3D3E3F;
}
}
.tabs {
flex: 1;
display: flex;
flex-direction: column;
overflow-y: auto;
justify-content: space-between;
@include media("
>
tablet
") {
height: 0px;
}
@include media("
<
desktop
") {
max-height:
4
00px;
max-height:
5
00px;
}
}
.ui.tab.active {
display: flex;
}
.tab[data-tab="
queue
"] {
flex-direction: column;
tr {
cursor: pointer;
}
}
.tab[data-tab="
library
"] {
flex-direction: column;
flex: 1 1 auto;
> .menu {
flex: 1;
flex-grow: 1;
}
> .player-wrapper {
width: 100%;
}
}
.sidebar .segment {
margin: 0;
border-radius: 0;
...
...
@@ -225,9 +271,6 @@ $sidebar-color: #3D3E3F;
.ui.inverted.segment.header-wrapper {
padding: 0;
}
.tabs {
flex: 1;
}
.logo {
cursor: pointer;
...
...
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