Commit d26926f4 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[Accessibility] Handed Symetric Tree is ok

parent 84bea376
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
.tree .node-actions .update-button.disabled { .tree .node-actions .update-button.disabled {
cursor: wait; cursor: wait;
} }
.tree .lefthanded ul {
margin-right: 19px;
}
.tree .lefthanded li .leaf { .tree .lefthanded li .leaf {
justify-content: flex-end; justify-content: flex-end;
} }
......
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
&.disabled &.disabled
cursor: wait cursor: wait
.lefthanded .lefthanded
li ul
.leaf margin-right : 19px
li
.leaf
justify-content : flex-end justify-content : flex-end
.righthanded .righthanded
......
...@@ -15,7 +15,7 @@ import Gargantext.Components.Forest.Tree (treeView) ...@@ -15,7 +15,7 @@ import Gargantext.Components.Forest.Tree (treeView)
import Gargantext.Ends (Frontends) import Gargantext.Ends (Frontends)
import Gargantext.Routes (AppRoute) import Gargantext.Routes (AppRoute)
import Gargantext.Sessions (Session(..), Sessions, OpenNodes, unSessions) import Gargantext.Sessions (Session(..), Sessions, OpenNodes, unSessions)
import Gargantext.Types (Reload, Handed) import Gargantext.Types (Reload, Handed(..))
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
type Props = type Props =
...@@ -49,7 +49,8 @@ forestCpt = R.hooksComponent "G.C.Forest.forest" cpt where ...@@ -49,7 +49,8 @@ forestCpt = R.hooksComponent "G.C.Forest.forest" cpt where
) )
(cpt' openNodes asyncTasks reload showLogin) (cpt' openNodes asyncTasks reload showLogin)
cpt' openNodes asyncTasks reload showLogin (frontends /\ route /\ sessions /\ _ /\ _ /\ _ /\ _ /\ handed) = do cpt' openNodes asyncTasks reload showLogin (frontends /\ route /\ sessions /\ _ /\ _ /\ _ /\ _ /\ handed) = do
pure $ R.fragment $ A.cons (plus showLogin) trees --pure $ R.fragment $ A.cons (plus showLogin) trees
pure $ R2.row $ [plus handed showLogin] <> trees
where where
trees = tree <$> unSessions sessions trees = tree <$> unSessions sessions
tree s@(Session {treeId}) = tree s@(Session {treeId}) =
...@@ -63,8 +64,11 @@ forestCpt = R.hooksComponent "G.C.Forest.forest" cpt where ...@@ -63,8 +64,11 @@ forestCpt = R.hooksComponent "G.C.Forest.forest" cpt where
, session: s , session: s
} }
plus :: R2.Setter Boolean -> R.Element plus :: Handed -> R2.Setter Boolean -> R.Element
plus showLogin = plus handed showLogin = H.div {className: if handed == RightHanded
then "flex-start"
else "flex-end"
} [
H.button { on: {click} H.button { on: {click}
, className: "btn btn-default" , className: "btn btn-default"
} }
...@@ -75,6 +79,7 @@ plus showLogin = ...@@ -75,6 +79,7 @@ plus showLogin =
--, H.div { "type": "", className: "fa fa-plus-circle fa-lg"} [] --, H.div { "type": "", className: "fa fa-plus-circle fa-lg"} []
--, H.div { "type": "", className: "fa fa-minus-circle fa-lg"} [] --, H.div { "type": "", className: "fa fa-minus-circle fa-lg"} []
] ]
]
-- TODO same as the one in the Login Modal (same CSS) -- TODO same as the one in the Login Modal (same CSS)
-- [ H.i { className: "material-icons md-36"} [] ] -- [ H.i { className: "material-icons md-36"} [] ]
where where
......
...@@ -133,7 +133,8 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p [] ...@@ -133,7 +133,8 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p []
, session , session
, tasks , tasks
, tree , tree
} _ = pure $ H.ul { className: "tree"} } _ = pure $ H.ul { className: "tree"
}
[ H.div { className: if handed == GT.RightHanded [ H.div { className: if handed == GT.RightHanded
then "righthanded" then "righthanded"
else "lefthanded" else "lefthanded"
......
...@@ -142,7 +142,8 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createEl ...@@ -142,7 +142,8 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createEl
{ className: "leaf " <> (dropClass droppedFile isDragOver) { className: "leaf " <> (dropClass droppedFile isDragOver)
, on: { drop: dropHandler droppedFile , on: { drop: dropHandler droppedFile
, dragOver: onDragOverHandler isDragOver , dragOver: onDragOverHandler isDragOver
, dragLeave: onDragLeave isDragOver } } , dragLeave: onDragLeave isDragOver }
}
where where
dropClass (Just _ /\ _) _ = "file-dropped" dropClass (Just _ /\ _) _ = "file-dropped"
dropClass _ (true /\ _) = "file-dropped" dropClass _ (true /\ _) = "file-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