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
150
Issues
150
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
bd285f72
Commit
bd285f72
authored
Sep 30, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[annotation] trying to fix show menu immediate show
parent
3edef9af
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
10 deletions
+23
-10
AnnotatedField.purs
src/Gargantext/Components/Annotation/AnnotatedField.purs
+20
-7
Node.purs
src/Gargantext/Components/Forest/Tree/Node.purs
+1
-1
Box.purs
src/Gargantext/Components/Forest/Tree/Node/Box.purs
+2
-2
No files found.
src/Gargantext/Components/Annotation/AnnotatedField.purs
View file @
bd285f72
...
...
@@ -53,13 +53,14 @@ annotatedFieldComponent = R2.hooksComponent thisModule "annotatedField" cpt
mMenu@(_ /\ setMenu) <- R.useState' Nothing
menuRef <- R.useRef Nothing
showMenuRef <- R.useRef Nothing
let wrapperProps = { className: "annotated-field-wrapper" }
onSelect :: String -> Maybe TermList -> MouseEvent -> Effect Unit
onSelect text' Nothing event = do
log2 "[onSelect] text'" text'
maybeShowMenu setMenu menuRef setTermList ngrams event
maybeShowMenu setMenu
showMenuRef
menuRef setTermList ngrams event
onSelect text' (Just list) event = do
log2 "[onSelect] text'" text'
log2 "[onSelect] list" list
...
...
@@ -79,6 +80,9 @@ annotatedFieldComponent = R2.hooksComponent thisModule "annotatedField" cpt
}
--setMenu (const $ menu)
R.setRef menuRef menu
case R.readRef showMenuRef of
Nothing -> pure unit
Just showMenu -> showMenu unit
mapCompile (Tuple t l) = {text: t, list: l, onSelect}
compiled = map mapCompile $ compile ngrams text
...
...
@@ -86,11 +90,12 @@ annotatedFieldComponent = R2.hooksComponent thisModule "annotatedField" cpt
runs =
HTML.div { className: "annotated-field-runs" } $ map annotateRun compiled
--pure $ HTML.div wrapperProps [maybeAddMenu mMenu runs]
pure $ HTML.div wrapperProps [ addMenu { menuRef }, runs ]
pure $ HTML.div wrapperProps [ addMenu { menuRef
, showMenuRef
}, runs ]
type AddMenuProps = (
menuRef :: R.Ref (Maybe AnnotationMenu)
menuRef :: R.Ref (Maybe AnnotationMenu)
, showMenuRef :: R.Ref (Maybe (Unit -> Effect Unit))
)
...
...
@@ -100,13 +105,18 @@ addMenu p = R.createElement addMenuCpt p []
addMenuCpt :: R.Component AddMenuProps
addMenuCpt = R2.hooksComponent thisModule "addMenu" cpt
where
cpt { menuRef } _ = do
cpt { menuRef
, showMenuRef
} _ = do
(mMenu /\ setmMenu) <- R.useState' (Nothing :: Maybe AnnotationMenu)
R.useEffect' $ do
R.setRef showMenuRef $ Just $ \_ -> do
log "[addMenu] showMenuRef called"
setmMenu $ const $ R.readRef menuRef
R.useEffect' $ do
let m = R.readRef menuRef
log2 "[addMenu] menuRef" m
log2 "[addMenu] mMenu" mMenu
--
log2 "[addMenu] menuRef" m
--
log2 "[addMenu] mMenu" mMenu
setmMenu $ const m
pure $ case mMenu of
...
...
@@ -114,7 +124,7 @@ addMenuCpt = R2.hooksComponent thisModule "addMenu" cpt
Just menu -> annotationMenu setmMenu menu
-- forall e. IsMouseEvent e => R2.Setter (Maybe AnnotationMenu) -> R2.Setter ? -> ? -> e -> Effect Unit
maybeShowMenu setMenu menuRef setTermList ngrams event = do
maybeShowMenu setMenu
showMenuRef
menuRef setTermList ngrams event = do
s <- Sel.getSelection
log2 "[maybeShowMenu] s" s
case s of
...
...
@@ -143,6 +153,9 @@ maybeShowMenu setMenu menuRef setTermList ngrams event = do
}
--setMenu (const $ menu)
R.setRef menuRef menu
case R.readRef showMenuRef of
Nothing -> pure unit
Just showMenu -> showMenu unit
Nothing -> pure unit
-- Nothing -> do
-- R.setRef menuRef Nothing
...
...
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
bd285f72
...
...
@@ -157,11 +157,11 @@ nodeMainSpan isLeaf p@{ dispatch, folderOpen, frontends, handed, session } = R.c
mNodePopupView props@{id, nodeType} onPopoverClose =
nodePopupView { id
, dispatch
, handed : props.handed
, name: name' props
, nodeType
, onPopoverClose
, session
, handed : props.handed
}
dropProps droppedFile isDragOver =
...
...
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
bd285f72
...
...
@@ -87,11 +87,11 @@ nodePopupCpt = R2.hooksComponent thisModule "nodePopupView" cpt
]
where
tooltipProps = { className : ""
, id : "node-popup-tooltip"
, title : "Node settings"
, data: { toggle : "tooltip"
, placement: "right"
}
, id : "node-popup-tooltip"
, title : "Node settings"
--, style: { top: y - 65.0, left: x + 10.0 }
}
...
...
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