Commit b9846ccb authored by Karen Konou's avatar Karen Konou

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

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