Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoadMoreVideos sooner #204

Merged
merged 2 commits into from
Jul 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/styles/_general.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
text-transform: capitalize;
}

%m-l-all-not-first {
.m-l-all-not-first {
// Add margin between buttons
& > *:not(:first-child) {
margin-left: 5px;
Expand Down
8 changes: 2 additions & 6 deletions src/views/VideoEditor.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div v-if="videoExists" ref="videoEditor" class="videoEditor">
<div class="topBar">
<div class="topBar m-l-all-not-first">
<Button icon="arrow" iconDirection="left" tooltip="Back To Videos" @click="$router.go(-1)" />
<span>{{ require("path").basename(video.videoPath) }}</span>
</div>
Expand All @@ -26,7 +26,7 @@
<div ref="clipsBar" id="clipsBar" class="clipsBar"></div>
</div>

<div class="controls">
<div class="controls m-l-all-not-first">
<Button @click="playPause" :icon="playPauseBtnIcon" />

<Button
Expand Down Expand Up @@ -699,8 +699,6 @@ export default class VideoPlayer extends Vue {
overflow-x: hidden;

.topBar {
@extend %m-l-all-not-first;

display: flex;
flex-flow: row;
align-items: center;
Expand All @@ -719,8 +717,6 @@ export default class VideoPlayer extends Vue {
}

.controls {
@extend %m-l-all-not-first;

display: flex;
align-items: center;
margin: 5px;
Expand Down
12 changes: 6 additions & 6 deletions src/views/Videos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ export default class extends Vue {

mounted() {
// Load initial set of recordings
this.loadMoreRecordings();
this.loadMoreVideos();

let el = document.getElementById("main");
el?.addEventListener("scroll", () => {
// If scrolled to bottom loadMoreRecordings
if (el?.scrollHeight! - el?.scrollTop! === el?.clientHeight!) {
this.loadMoreRecordings();
// If scrolled to bottom loadMoreVideos
if (el?.scrollHeight! - el?.scrollTop! - 200 <= el?.clientHeight!) {
this.loadMoreVideos();
}
});
}
Expand All @@ -113,13 +113,13 @@ export default class extends Vue {
this.videos = this.allClips;
}

this.loadMoreRecordings();
this.loadMoreVideos();
}

/**
* Load more recordings into view
*/
loadMoreRecordings() {
loadMoreVideos() {
// How many videos to load in
let videosToLoad = 8;

Expand Down