Commit d02b66cb authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski Committed by Alexandre Delanoë

[ngrams] move search up the tree

Now focus works.
parent cf8f8cb2
...@@ -291,10 +291,6 @@ searchInputCpt = R.hooksComponent "G.C.NT.searchInput" cpt ...@@ -291,10 +291,6 @@ searchInputCpt = R.hooksComponent "G.C.NT.searchInput" cpt
, placeholder: "Search" , placeholder: "Search"
, type: "value" } , type: "value" }
toggleMaybe :: forall a. a -> Maybe a -> Maybe a
toggleMaybe _ (Just _) = Nothing
toggleMaybe b Nothing = Just b
-- NEXT -- NEXT
data Action' data Action'
= SetParentResetChildren' (Maybe NgramsTerm) = SetParentResetChildren' (Maybe NgramsTerm)
...@@ -353,7 +349,8 @@ loadedNgramsTableSpecCpt = R.hooksComponent "G.C.NT.loadedNgramsTable" cpt ...@@ -353,7 +349,8 @@ loadedNgramsTableSpecCpt = R.hooksComponent "G.C.NT.loadedNgramsTable" cpt
pure $ R.fragment $ pure $ R.fragment $
autoUpdate <> resetSaveButtons <> [ autoUpdate <> resetSaveButtons <> [
T.table { colNames search
, T.table { colNames
, container: tableContainer { dispatch: performAction , container: tableContainer { dispatch: performAction
, ngramsChildren , ngramsChildren
, ngramsParent , ngramsParent
......
...@@ -300,3 +300,8 @@ foreign import _setCookie :: EffectFn1 String Unit ...@@ -300,3 +300,8 @@ foreign import _setCookie :: EffectFn1 String Unit
setCookie :: String -> Effect Unit setCookie :: String -> Effect Unit
setCookie = runEffectFn1 _setCookie setCookie = runEffectFn1 _setCookie
focus :: Nullable R.Element -> Effect Unit
focus nEl = case toMaybe nEl of
Nothing -> pure unit
Just el -> el ... "focus" $ []
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