Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
purescript-gargantext
Commits
94083247
Commit
94083247
authored
Dec 19, 2024
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '717-dev-locate-in-tree' into 'dev'
Resolve ""locate in tree"" See merge request
!492
parents
4868dbf0
07c69250
Pipeline
#7162
passed with stages
in 18 minutes and 14 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
6 deletions
+34
-6
Forest.purs
src/Gargantext/Components/Forest.purs
+27
-0
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+0
-6
Node.purs
src/Gargantext/Components/Forest/Tree/Node.purs
+7
-0
No files found.
src/Gargantext/Components/Forest.purs
View file @
94083247
...
...
@@ -7,6 +7,7 @@ import Data.Array as A
import Data.Map (empty)
import Data.Map as Map
import Data.Maybe (Maybe(..), fromMaybe)
import Effect (Effect)
import Gargantext.Components.App.Store as Store
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (ButtonVariant(..), Position(..), TooltipPosition(..), Variant(..))
...
...
@@ -90,6 +91,12 @@ plusCpt = here.component "plus" cpt
_ <- T.write Nothing backend
T.write_ true showLogin
locateInTree _ = do
mEl <- R2.querySelector ".forest-layout__tree .mainleaf--selected"
case mEl of
Nothing -> pure unit
Just el -> R2.scrollIntoView el
-- Render
pure $
H.div { className: "forest-layout__actions position-sticky top-0 py-1 bg-light" }
...
...
@@ -178,6 +185,26 @@ plusCpt = here.component "plus" cpt
]
}
]
, H.div
{ className: "forest-layout__top_action" }
[ B.tooltipContainer
{ delayShow: 600
, position: TooltipPosition Right
, tooltipSlot:
B.span_ "Locate current node in tree"
, defaultSlot:
B.button
{ className: "w-100 text-small px-2"
, callback: locateInTree
, variant: ButtonVariant Light
}
[ B.icon
{ name: "bullseye" }
, B.wad_ [ "d-inline-block", "w-1" ]
, B.span_ "Locate in tree"
]
}
]
{-
,
...
...
src/Gargantext/Components/Forest/Tree.purs
View file @
94083247
...
...
@@ -211,12 +211,6 @@ treeCpt = here.component "tree" cpt
let action = NT.InsertCallback (NT.UpdateTree root) ("tree-" <> show root) cb
Notifications.performAction ws action
R.useEffect' do
selectedLeaf <- R2.querySelector ".mainleaf--selected"
case selectedLeaf of
Nothing -> pure unit
Just el -> R2.scrollIntoView el
pure $
H.div
{ className: intercalate " "
...
...
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
94083247
...
...
@@ -267,6 +267,13 @@ nodeSpanCpt = here.component "nodeSpan" cpt
let action = NT.InsertCallback (NT.UpdateTree props.id) ("node-span-" <> show props.id) cb
Notifications.performAction ws action
R.useEffectOnce' $ do
when isSelected $ do
mEl <- R2.querySelector ".forest-layout__tree .mainleaf--selected"
case mEl of
Nothing -> pure unit
Just el -> R2.scrollIntoView el
-- Render
pure $
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment