diff --git a/src/components/asset-panel/selector.jsx b/src/components/asset-panel/selector.jsx index a9f69134b..88d609723 100644 --- a/src/components/asset-panel/selector.jsx +++ b/src/components/asset-panel/selector.jsx @@ -13,6 +13,7 @@ import styles from './selector.css'; const Selector = props => { const { buttons, + containerRef, dragType, items, selectedItemIndex, @@ -46,7 +47,10 @@ const Selector = props => { } return ( - + {items.map((item, index) => ( + {items.map((sprite, index) => { // If the sprite has just received a block drop, used for green highlight @@ -42,7 +46,14 @@ const SpriteList = function (props) { ); // If the sprite is indicating it can receive block dropping, used for blue highlight - const isRaised = !receivedBlocks && raised && sprite.id !== editingTarget; + let isRaised = !receivedBlocks && raised && sprite.id !== editingTarget; + + // A sprite is also raised if a costume or sound is being dragged. + // Note the absence of the self-sharing check: a sprite can share assets with itself. + // This is a quirk of 2.0, but seems worth leaving possible, it + // allows quick (albeit unusual) duplication of assets. + isRaised = isRaised || draggingType === DragConstants.COSTUME || + draggingType === DragConstants.SOUND; return ( = left && x <= right && y >= top && y <= bottom) { + mouseOverIndex = indexForPositionOnList( + this.props.dragInfo.currentOffset, this.boxes); + } } return mouseOverIndex; } + setRef (el) { + this.ref = el; + } render () { const {dragInfo: {index: dragIndex, dragType}, items} = this.props; const mouseOverIndex = this.getMouseOverIndex(); const ordering = this.getOrdering(items, dragIndex, mouseOverIndex); return (