Commit 9085a90e authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[NgramsTable] fixes to annotation menu -- it closes now after selecting option

parent 8b7aae81
...@@ -17,9 +17,7 @@ import Data.Lens.At (at) ...@@ -17,9 +17,7 @@ import Data.Lens.At (at)
import Data.Maybe ( Maybe(..), maybe, maybe' ) import Data.Maybe ( Maybe(..), maybe, maybe' )
import Data.Tuple ( Tuple(..) ) import Data.Tuple ( Tuple(..) )
import Data.Tuple.Nested ( (/\) ) import Data.Tuple.Nested ( (/\) )
import DOM.Simple.Console ( log, log2 )
import DOM.Simple.Event as DE import DOM.Simple.Event as DE
import Effect.Class ( liftEffect )
import Effect ( Effect ) import Effect ( Effect )
import Effect.Uncurried ( mkEffectFn1 ) import Effect.Uncurried ( mkEffectFn1 )
import Reactix as R import Reactix as R
...@@ -58,7 +56,9 @@ annotatedFieldComponent = R.hooksComponent "AnnotatedField" cpt ...@@ -58,7 +56,9 @@ annotatedFieldComponent = R.hooksComponent "AnnotatedField" cpt
onSelect text' (Just list) event = do onSelect text' (Just list) event = do
let x = E.clientX event let x = E.clientX event
y = E.clientY event y = E.clientY event
setList = setTermList text' (Just list) setList t = do
setTermList text' (Just list) t
setMenu Nothing
setMenu $ Just {x, y, list: Just list, menuType: SetTermListItem, setList} setMenu $ Just {x, y, list: Just list, menuType: SetTermListItem, setList}
mapCompile (Tuple t l) = {text: t, list: l, onSelect} mapCompile (Tuple t l) = {text: t, list: l, onSelect}
...@@ -79,7 +79,9 @@ maybeShowMenu setMenu setTermList ngrams event = do ...@@ -79,7 +79,9 @@ maybeShowMenu setMenu setTermList ngrams event = do
let x = E.clientX event let x = E.clientX event
y = E.clientY event y = E.clientY event
list = findNgram ngrams sel' list = findNgram ngrams sel'
setList = setTermList sel' list setList t = do
setTermList sel' list t
setMenu Nothing
E.preventDefault event E.preventDefault event
setMenu $ Just { x, y, list, menuType: NewNgram, setList } setMenu $ Just { x, y, list, menuType: NewNgram, setList }
Nothing -> pure unit Nothing -> pure unit
......
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