Commit b9846ccb authored by Karen Konou's avatar Karen Konou

[Ngrams table] keep position when editing by keeping tree expanded

parent 1ce56e02
Pipeline #5370 failed with stage
in 0 seconds
......@@ -11461,6 +11461,11 @@ select.form-control {
font-size: 0.85rem;
}
.tree-expanded {
padding-top: 12px;
padding-bottom: 12px;
}
.annotation-run {
cursor: pointer;
}
......
......@@ -11265,6 +11265,11 @@ select.form-control {
font-size: 0.85rem;
}
.tree-expanded {
padding-top: 12px;
padding-bottom: 12px;
}
.annotation-run {
cursor: pointer;
}
......
......@@ -11027,6 +11027,11 @@ select.form-control {
font-size: 0.85rem;
}
.tree-expanded {
padding-top: 12px;
padding-bottom: 12px;
}
.annotation-run {
cursor: pointer;
}
......
......@@ -11275,6 +11275,11 @@ select.form-control {
font-size: 0.85rem;
}
.tree-expanded {
padding-top: 12px;
padding-bottom: 12px;
}
.annotation-run {
cursor: pointer;
}
......
......@@ -11276,6 +11276,11 @@ select.form-control {
font-size: 0.85rem;
}
.tree-expanded {
padding-top: 12px;
padding-bottom: 12px;
}
.annotation-run {
cursor: pointer;
}
......
......@@ -2,6 +2,7 @@ module Gargantext.Components.NgramsTable.Tree where
import Gargantext.Prelude
import Data.Array (length)
import Data.Array as A
import Data.Lens ((^..), (^.), view)
import Data.Lens.Fold (folded)
......@@ -291,18 +292,33 @@ renderNgramsItemCpt = here.component "renderNgramsItem" cpt
H.div {}
( if isEditing'
then
[
B.iconButton
{ name: "plus"
, className: "mr-1 align-bottom"
, overlay: false
, variant: Primary
, callback: const $ dispatch $ ToggleChild true ngrams
}
,
R2.buff $
tag [ text $ " " <> ngramsTermText ngramsDepth.ngrams ]
]
if (length $ getNgramsChildren' ngrams) > 0
then
[ H.div {className: "tree-expanded"} [
B.iconButton
{ name: "plus"
, className: "mr-1 align-bottom"
, overlay: false
, variant: Primary
, callback: const $ dispatch $ ToggleChild true ngrams
}
,
R2.buff $
tag [ text $ " " <> ngramsTermText ngramsDepth.ngrams ]
] ]
else
[
B.iconButton
{ name: "plus"
, className: "mr-1 align-bottom"
, overlay: false
, variant: Primary
, callback: const $ dispatch $ ToggleChild true ngrams
}
,
R2.buff $
tag [ text $ " " <> ngramsTermText ngramsDepth.ngrams ]
]
else
[
renderNgramsTree
......
......@@ -335,3 +335,7 @@
.context-item-date
color: $gray-600
font-size: .85rem
.tree-expanded
padding-top: 12px
padding-bottom: 12px
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