Skip to content

Commit

Permalink
wip remove opacity styling, remove other drag code
Browse files Browse the repository at this point in the history
  • Loading branch information
gwwar committed Aug 18, 2021
1 parent 03b315a commit 7116d09
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 412 deletions.
8 changes: 0 additions & 8 deletions packages/block-editor/src/components/list-view/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export default function ListViewBlock( {
setDraggingId,
collapse,
expand,
targetId,
} = useListViewContext();

//TODO: handle block delete
Expand All @@ -105,12 +104,6 @@ export default function ListViewBlock( {
{ 'is-visible': isHovered }
);

const isFaded =
draggingId &&
draggingId !== clientId &&
block?.dropContainer === false &&
block?.dropSibling === false;

// If ListView has experimental features related to the Persistent List View,
// only focus the selected list item on mount; otherwise the list would always
// try to steal the focus from the editor canvas.
Expand Down Expand Up @@ -157,7 +150,6 @@ export default function ListViewBlock( {
'is-last-of-selected-branch':
withExperimentalPersistentListViewFeatures &&
isLastOfSelectedBranch,
'is-faded': isFaded,
'is-moving': draggingId === clientId, //avoid is-dragging which has an !important rule
} );

Expand Down
125 changes: 0 additions & 125 deletions packages/block-editor/src/components/list-view/drop-indicator.js

This file was deleted.

4 changes: 2 additions & 2 deletions packages/block-editor/src/components/list-view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export default function ListView( {
//TODO: simplify state and code
const { clientId } = block;
const ITEM_HEIGHT = 36;
const UPDATE_PARENT_THRESHOLD = 20;
const LEFT_RIGHT_DRAG_THRESHOLD = 20;

const v = velocity?.get() ?? 0;
if ( v === 0 ) {
Expand Down Expand Up @@ -312,7 +312,7 @@ export default function ListView( {
return;
}

if ( Math.abs( translateX ) > UPDATE_PARENT_THRESHOLD ) {
if ( Math.abs( translateX ) > LEFT_RIGHT_DRAG_THRESHOLD ) {
const steps = Math.ceil( Math.abs( translate / ITEM_HEIGHT ) );
const nextIndex =
direction === UP ? listPosition - steps : listPosition + steps;
Expand Down
4 changes: 0 additions & 4 deletions packages/block-editor/src/components/list-view/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
// Use position relative for row animation.
position: relative;

&.is-faded {
opacity: 0.5 !important;//TODO: just for debugging, need to let framer control opacity
}

&.is-selected .block-editor-list-view-block-contents {
background: var(--wp-admin-theme-color);
color: $white;
Expand Down
Loading

0 comments on commit 7116d09

Please sign in to comment.