mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
fix scrolling issue in sidebar search components
This commit is contained in:
committed by
Mungai Njoroge
parent
6095c9fa8f
commit
532d0efabe
@@ -28,24 +28,26 @@
|
|||||||
<span class="status"
|
<span class="status"
|
||||||
>Last updated {{ info.last_updated }}  |  </span
|
>Last updated {{ info.last_updated }}  |  </span
|
||||||
>
|
>
|
||||||
<span class="edit" @click="editPlaylist">Edit</span>
|
<span class="edit" @click="editPlaylist">Edit  |</span>
|
||||||
|
<DeleteSvg class="edit"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
|
import { storeToRefs } from "pinia";
|
||||||
|
|
||||||
import useNavStore from "@/stores/nav";
|
import useNavStore from "@/stores/nav";
|
||||||
import usePStore from "@/stores/pages/playlist";
|
import usePStore from "@/stores/pages/playlist";
|
||||||
import useModalStore from "../../stores/modal";
|
import useModalStore from "@/stores/modal";
|
||||||
|
|
||||||
|
import { paths } from "@/config";
|
||||||
import { playSources } from "@/composables/enums";
|
import { playSources } from "@/composables/enums";
|
||||||
import { formatSeconds, useVisibility } from "@/utils";
|
import { formatSeconds, useVisibility } from "@/utils";
|
||||||
import { paths } from "../../config";
|
|
||||||
|
|
||||||
import { storeToRefs } from "pinia";
|
|
||||||
import PlayBtnRect from "../shared/PlayBtnRect.vue";
|
import PlayBtnRect from "../shared/PlayBtnRect.vue";
|
||||||
|
import DeleteSvg from "@/assets/icons/delete.svg";
|
||||||
|
|
||||||
const modal = useModalStore();
|
const modal = useModalStore();
|
||||||
const nav = useNavStore();
|
const nav = useNavStore();
|
||||||
@@ -89,7 +91,7 @@ function editPlaylist() {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 1rem;
|
bottom: 1rem;
|
||||||
right: 1rem;
|
right: 1rem;
|
||||||
padding: 0.5rem;
|
padding: $smaller $small;
|
||||||
background-color: $body;
|
background-color: $body;
|
||||||
color: rgb(255, 255, 255);
|
color: rgb(255, 255, 255);
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
@@ -97,14 +99,12 @@ function editPlaylist() {
|
|||||||
box-shadow: 0 0 1rem rgba(0, 0, 0, 0.479);
|
box-shadow: 0 0 1rem rgba(0, 0, 0, 0.479);
|
||||||
z-index: 12;
|
z-index: 12;
|
||||||
|
|
||||||
@include phone-only {
|
display: flex;
|
||||||
bottom: 1rem;
|
align-items: center;
|
||||||
right: 1rem;
|
|
||||||
font-size: small;
|
|
||||||
|
|
||||||
.status {
|
svg {
|
||||||
display: none;
|
transform: scale(.75);
|
||||||
}
|
margin-bottom: -0.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.edit {
|
.edit {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="right-search">
|
<div class="right-search">
|
||||||
<TabsWrapper
|
<TabsWrapper
|
||||||
:isOnSearchPage="isOnSearchPage"
|
|
||||||
:tabs="tabs"
|
:tabs="tabs"
|
||||||
@switchTab="switchTab"
|
@switchTab="switchTab"
|
||||||
:currentTab="currentTab"
|
:currentTab="currentTab"
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div style="height: 100%">
|
||||||
<component :is="getComponent()?.component" v-bind="getComponent()?.props" />
|
<component :is="getComponent()?.component" v-bind="getComponent()?.props" />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="right-tabs" :class="tabContent">
|
<div id="right-tabs" :class="{ tabContent: tabContent }">
|
||||||
<div class="tab-buttons-wrapper">
|
<div class="tab-buttons-wrapper">
|
||||||
<div class="tabheaders rounded-sm no-scroll">
|
<div class="tabheaders rounded-sm no-scroll">
|
||||||
<div
|
<div
|
||||||
@@ -34,21 +34,25 @@ const emit = defineEmits<{
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
#right-tabs {
|
#right-tabs {
|
||||||
height: 100%;
|
|
||||||
display: grid;
|
display: grid;
|
||||||
|
position: absolute; // TODO: Find a way to fix scrollability without using position absolute.
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
.tab-buttons-wrapper {
|
.tab-buttons-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#tab-content {
|
#tab-content {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
padding-bottom: 1rem;
|
padding-bottom: 1rem;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#right-tabs.tabContent {
|
#right-tabs.tabContent {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="nav-search-input">
|
<div class="nav-search-input">
|
||||||
<SearchInput :on_nav="true" />
|
<SearchInput :on_nav="true" />
|
||||||
|
<div class="buttons-area">
|
||||||
<Tabs
|
<Tabs
|
||||||
:tabs="tabs"
|
:tabs="tabs"
|
||||||
:currentTab="($route.params.page as string)"
|
:currentTab="($route.params.page as string)"
|
||||||
@@ -12,16 +13,17 @@
|
|||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Tabs from "@/components/RightSideBar/Search/TabsWrapper.vue";
|
|
||||||
import SearchInput from "@/components/RightSideBar/SearchInput.vue";
|
|
||||||
import { Routes } from "@/router/routes";
|
import { Routes } from "@/router/routes";
|
||||||
|
|
||||||
import useSearchStore from "@/stores/search";
|
import useSearchStore from "@/stores/search";
|
||||||
const search = useSearchStore();
|
import Tabs from "@/components/RightSideBar/Search/TabsWrapper.vue";
|
||||||
|
import SearchInput from "@/components/RightSideBar/SearchInput.vue";
|
||||||
|
|
||||||
|
const search = useSearchStore();
|
||||||
const tabs = ["tracks", "albums", "artists"];
|
const tabs = ["tracks", "albums", "artists"];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -32,9 +34,19 @@ const tabs = ["tracks", "albums", "artists"];
|
|||||||
grid-template-columns: 1fr max-content;
|
grid-template-columns: 1fr max-content;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
|
|
||||||
|
.buttons-area {
|
||||||
|
position: relative;
|
||||||
|
height: 100%;
|
||||||
|
width: 12rem;
|
||||||
|
}
|
||||||
|
|
||||||
#right-tabs {
|
#right-tabs {
|
||||||
display: grid;
|
width: max-content;
|
||||||
align-items: center;
|
height: max-content;
|
||||||
|
|
||||||
|
.tabheaders {
|
||||||
|
height: 38px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabheaders {
|
.tabheaders {
|
||||||
|
|||||||
@@ -83,10 +83,14 @@ export default defineStore("search", () => {
|
|||||||
if (!query) return;
|
if (!query) return;
|
||||||
|
|
||||||
searchTracks(query).then((data) => {
|
searchTracks(query).then((data) => {
|
||||||
const scrollable = document.getElementById(
|
let scrollable = document.getElementById(
|
||||||
"songlist-scroller"
|
"songlist-scroller"
|
||||||
) as HTMLElement;
|
) as HTMLElement;
|
||||||
|
|
||||||
|
if (scrollable === null) {
|
||||||
|
scrollable = document.createElement("div");
|
||||||
|
}
|
||||||
|
|
||||||
waitForScrollEnd(scrollable, 0).then(() => {
|
waitForScrollEnd(scrollable, 0).then(() => {
|
||||||
tracks.value = data.tracks;
|
tracks.value = data.tracks;
|
||||||
tracks.more = data.more;
|
tracks.more = data.more;
|
||||||
|
|||||||
Reference in New Issue
Block a user