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

fix: non draggable clips #179

Merged
merged 1 commit into from
Feb 14, 2024
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 ClientApp/src/components/Bookmark.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface Props {

export const Bookmark = forwardRef<HTMLDivElement, Props>(
({ id, time = 0, type = BookmarkType.Manual }, ref) => {
let className = 'grid grid-flow-col absolute rounded-lg h-full bg-yellow-400';
let className = 'grid grid-flow-col absolute rounded-lg h-full bg-yellow-400 bookmark';
return (
<div
ref={ref}
Expand Down
16 changes: 2 additions & 14 deletions ClientApp/src/pages/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,20 +177,8 @@ export const Player: React.FC<Props> = ({ videos }) => {

// Enables clicking on the bookmark icon.
function findBookmarkAncestorOrSelf(element: HTMLDivElement): HTMLDivElement {
if (element.hasAttribute('data-index')) {
return element;
}

let parentElement: HTMLElement | null = element.parentElement;
while (parentElement) {
if (parentElement.hasAttribute('data-index')) {
return parentElement as HTMLDivElement;
}
parentElement = parentElement.parentElement;
}

// If no parent with data-index was found, return the original element
return element;
const bookmarkElement = element.closest('.bookmark');
return bookmarkElement as HTMLDivElement || element;
}

function handleOnMouseUp(e: MouseEvent) {
Expand Down