Bug Fix: Dragging to an empty column is impossible

This commit is contained in:
Emi Simpson 2023-07-04 22:28:08 -04:00
parent 22b42fd26f
commit 05d0ab9e56
Signed by: Emi
GPG Key ID: A12F2C2FFDC3D847
1 changed files with 6 additions and 3 deletions

View File

@ -136,7 +136,9 @@ viewHoverTile = div [id "hover-tile"] []
viewColumn : Maybe HeldTile -> Int -> Column -> Html Msg
viewColumn heldOverTile columnIndex {name, tiles} =
let
onlyTrueActivityTiles = Array.indexedMap (viewTile (isJust heldOverTile) columnIndex) tiles
isTileHeld = isJust heldOverTile
tileCount = Array.length tiles
onlyTrueActivityTiles = Array.indexedMap (viewTile isTileHeld columnIndex) tiles
trueActivityTilesPlusHoverTile = case heldOverTile of
Nothing -> onlyTrueActivityTiles
Just {hoveredColumnIndex, hoveredTileIndex} ->
@ -210,12 +212,13 @@ viewGrip colIndx tileIndx tile =
gripPath = "m17.697 3.3505e-8a17.698 17.698 0 0 0-17.697 17.697 17.698 17.698 0 0 0 17.697 17.699 17.698 17.698 0 0 0 17.699-17.699 17.698 17.698 0 0 0-17.699-17.697zm68 0a17.698 17.698 0 0 0-17.697 17.697 17.698 17.698 0 0 0 17.697 17.699 17.698 17.698 0 0 0 17.699-17.699 17.698 17.698 0 0 0-17.699-17.697zm-68 68a17.698 17.698 0 0 0-17.697 17.697 17.698 17.698 0 0 0 17.697 17.699 17.698 17.698 0 0 0 17.699-17.699 17.698 17.698 0 0 0-17.699-17.697zm68 0a17.698 17.698 0 0 0-17.697 17.697 17.698 17.698 0 0 0 17.697 17.699 17.698 17.698 0 0 0 17.699-17.699 17.698 17.698 0 0 0-17.699-17.697z"
viewAddTile : Int -> Html Msg
viewAddTile columnIndex =
viewAddTile : Bool -> Int -> Int -> Html Msg
viewAddTile isTileHeld columnIndex tileCount =
button
[ class "add-tile"
, class "tile"
, onClick (AddTile columnIndex)
, attributeIf isTileHeld (onMouseEnter <| HeldOverNewTile columnIndex tileCount)
]
[ text "+" ]