Commit 909c57b3 authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge remote-tracking branch 'origin/dev-tree-fixes-without-webpack' into dev-demo-merge

parents d6aa4382 0add6647
...@@ -204,6 +204,9 @@ text-align: center; ...@@ -204,6 +204,9 @@ text-align: center;
.tree { .tree {
margin-top: 10px; margin-top: 10px;
} }
.tree .file-dropped {
background-color: aliceblue;
}
#graph-tree .tree { #graph-tree .tree {
margin-top: 27px; margin-top: 27px;
} }
......
...@@ -538,12 +538,14 @@ toHtml d s@(NTree (LNode {id, name, nodeType}) ary) n = R.createElement el {} [] ...@@ -538,12 +538,14 @@ toHtml d s@(NTree (LNode {id, name, nodeType}) ary) n = R.createElement el {} []
folderIcon folderOpen@(open /\ _) = folderIcon folderOpen@(open /\ _) =
H.a {onClick: R2.effToggler folderOpen} H.a {onClick: R2.effToggler folderOpen}
[ H.i {className: fldr open} [] ] [ H.i {className: fldr open} [] ]
dropProps (_ /\ setDroppedFile) = { dropProps (droppedFile /\ setDroppedFile) = {
onDrop: dropHandler className: dropClass droppedFile
, onDrop: dropHandler setDroppedFile
, onDragOver: onDragOverHandler , onDragOver: onDragOverHandler
} }
where dropClass (Just _) = "file-dropped"
dropHandler = mkEffectFn1 $ \e -> unsafePartial $ do dropClass Nothing = ""
dropHandler setDroppedFile = mkEffectFn1 $ \e -> unsafePartial $ do
let ff = fromJust $ item 0 $ ((e .. "dataTransfer" .. "files") :: FileList) let ff = fromJust $ item 0 $ ((e .. "dataTransfer" .. "files") :: FileList)
liftEffect $ log2 "drop:" ff liftEffect $ log2 "drop:" ff
-- prevent redirection when file is dropped -- prevent redirection when file is dropped
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment