Skip to content

A self-hosted media server and file management system

fix folder and history panel scrolling

aminnausin5462e93acfa1
diff --git a/resources/js/components/video/VideoPlayer.vue b/resources/js/components/video/VideoPlayer.vue
index 57623b8a..63d265d7 100644
--- a/resources/js/components/video/VideoPlayer.vue
+++ b/resources/js/components/video/VideoPlayer.vue
@@ -88,20 +88,12 @@ const { stateVideo } = storeToRefs(ContentStore);
const { createRecord, updateViewCount } = ContentStore;
const initVideoPlayer = () => {
- // let vidSource = document.getElementById('vid-source');
let root = document.getElementById('root');
-
root.scrollIntoView();
-
- // if (pastFirst.value === true) vidSource.play();
}
const playVideo = () => {
- console.log(stateVideo.value.id);
- if(currentID.value === stateVideo.value.id){
- console.log(stateVideo.value.id + ' already seen');
- return;
- }// stop recording every time video seek
+ if(currentID.value === stateVideo.value.id) return; // stop recording every time video seek
currentID.value = stateVideo.value.id;
createRecord(stateVideo.value.id);
updateViewCount(stateVideo.value.id);
diff --git a/resources/js/stores/AppStore.js b/resources/js/stores/AppStore.js
index 663ad828..e1738d5c 100644
--- a/resources/js/stores/AppStore.js
+++ b/resources/js/stores/AppStore.js
@@ -26,11 +26,9 @@ export const useAppStore = defineStore('App', () => {
if(selectedSideBar.value === target) {
selectedSideBar.value = '';
document.getElementById('root').scrollIntoView({behavior: "smooth"});
+ return;
}
- else {
- selectedSideBar.value = target;
- document.querySelector('#list-card').scrollIntoView({behavior: "smooth"});
- }
+ selectedSideBar.value = target;
};
return {
diff --git a/resources/js/views/VideoView.vue b/resources/js/views/VideoView.vue
index 446983bf..c95a5f7e 100644
--- a/resources/js/views/VideoView.vue
+++ b/resources/js/views/VideoView.vue
@@ -6,7 +6,7 @@ import VideoTable from '../components/video/VideoTable.vue';
import CircumShare1 from '~icons/circum/share-1';
-import { onMounted, watch } from 'vue';
+import { nextTick, onMounted, watch } from 'vue';
import { useContentStore } from '../stores/ContentStore';
import { useAppStore } from '../stores/AppStore';
import { storeToRefs } from 'pinia';
@@ -24,8 +24,10 @@ const metaData = useMetaData(stateVideo.value.attributes);
async function cycleSideBar(state) {
if (state === "history") {
- getRecords(10);
+ await getRecords(10);
}
+ await nextTick();
+ document.querySelector('#list-card').scrollIntoView({behavior: "smooth"});
}
async function reload(nextFolderName) {
@@ -41,7 +43,6 @@ onMounted(async () => {
const handlePropsUpdate = () => {
metaData.updateData(stateVideo.value.attributes);
- console.log(metaData.fields);
}
watch(() => route.params.folder, reload, { immediate: false });