FloatingPlayer: Minor function-renaming for clarity

This commit is contained in:
infiinte-persistence 2020-09-09 10:14:51 +08:00 committed by Sean Yesmunt
parent 92611af9c0
commit ddfc2a54b8

View file

@ -90,12 +90,12 @@ export default function FileRenderFloating(props: Props) {
return null; return null;
} }
function handleStart(e, ui) { function handleDragStart(e, ui) {
// Not really necessary, but reset just in case 'handleStop' didn't fire. // Not really necessary, but reset just in case 'handleStop' didn't fire.
setWasDragging(false); setWasDragging(false);
} }
function handleDrag(e, ui) { function handleDragMove(e, ui) {
setWasDragging(true); setWasDragging(true);
const { x, y } = position; const { x, y } = position;
@ -107,7 +107,7 @@ export default function FileRenderFloating(props: Props) {
}); });
} }
function handleStop(e, ui) { function handleDragStop(e, ui) {
if (wasDragging) { if (wasDragging) {
e.stopPropagation(); e.stopPropagation();
setWasDragging(false); setWasDragging(false);
@ -116,9 +116,9 @@ export default function FileRenderFloating(props: Props) {
return ( return (
<Draggable <Draggable
onDrag={handleDrag} onDrag={handleDragMove}
onStart={handleStart} onStart={handleDragStart}
onStop={handleStop} onStop={handleDragStop}
defaultPosition={position} defaultPosition={position}
position={isFloating ? position : { x: 0, y: 0 }} position={isFloating ? position : { x: 0, y: 0 }}
bounds="parent" bounds="parent"