diff --git a/src/components/cards/cards.jsx b/src/components/cards/cards.jsx index 0179675124b070b0e0610b5feaa57ced69fb1270..8eacc5b442bed1416dde64cca83ab61f04a8def7 100644 --- a/src/components/cards/cards.jsx +++ b/src/components/cards/cards.jsx @@ -266,9 +266,9 @@ const Cards = props => { // Tutorial cards need to calculate their own dragging bounds // to allow for dragging the cards off the left, right and bottom - // edges of the workspace, used in the custom overlay 'card-container-overlay' - const cardHorizontalOffset = 400; // 80% of approx. card width - const cardVerticalOffset = 256; // 80% of approx. card height + // edges of the workspace. + const cardHorizontalOffset = 400; // ~80% of card width + const cardVerticalOffset = expanded ? 257 : 0; // ~80% of card height, if expanded const menuBarHeight = 48; // TODO: get pre-calculated from elsewhere? if (x === 0 && y === 0) { @@ -285,7 +285,7 @@ const Cards = props => { const steps = content[activeDeckId].steps; return ( - // Use a custom overlay to act as the bounding parent for the draggable + // Custom overlay to act as the bounding parent for the draggable, using values from above <div className={styles.cardContainerOverlay} style={{ diff --git a/src/reducers/cards.js b/src/reducers/cards.js index 4e5c4af11b292d7fb60e617d1678bcb8f3e43b71..c54161f4cb4d569f777e3206ace3fca0c3c8e952 100644 --- a/src/reducers/cards.js +++ b/src/reducers/cards.js @@ -31,8 +31,6 @@ const reducer = function (state, action) { visible: false }); case SHRINK_EXPAND_CARDS: - // Set new position here based on bounds - console.log('TODO: set new position based on bounds'); return Object.assign({}, state, { expanded: !state.expanded });