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
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Grégoire Locqueville
purescript-gargantext
Commits
1aed5d91
Commit
1aed5d91
authored
May 15, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ngrams] fix indeterminate checkbox selection
parent
d5d02605
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+2
-2
Reactix.purs
src/Gargantext/Utils/Reactix.purs
+1
-4
No files found.
src/Gargantext/Components/NgramsTable.purs
View file @
1aed5d91
...
@@ -25,6 +25,7 @@ import Data.Tuple (Tuple(..), fst, snd)
...
@@ -25,6 +25,7 @@ import Data.Tuple (Tuple(..), fst, snd)
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log2)
import DOM.Simple.Console (log2)
import Effect (Effect)
import Effect (Effect)
import FFI.Simple (delay)
import Prelude (class Show, Unit, bind, const, discard, identity, map, mempty, not, otherwise, pure, show, unit, (#), ($), (&&), (+), (/=), (<$>), (<<<), (<>), (=<<), (==), (||))
import Prelude (class Show, Unit, bind, const, discard, identity, map, mempty, not, otherwise, pure, show, unit, (#), ($), (&&), (+), (/=), (<$>), (<<<), (<>), (=<<), (==), (||))
import React.DOM (a, span, text)
import React.DOM (a, span, text)
import React.DOM.Props (onClick, style)
import React.DOM.Props (onClick, style)
...
@@ -515,12 +516,11 @@ selectionCheckboxCpt = R.hooksComponent "G.C.NT.selectionCheckbox" cpt
...
@@ -515,12 +516,11 @@ selectionCheckboxCpt = R.hooksComponent "G.C.NT.selectionCheckbox" cpt
cpt { allNgramsSelected, dispatch, ngramsSelection } _ = do
cpt { allNgramsSelected, dispatch, ngramsSelection } _ = do
ref <- R.useRef null
ref <- R.useRef null
R.useEffect' $ do
R.useEffect' $ d
elay unit $ \_ -> d
o
let mCb = toMaybe $ R.readRef ref
let mCb = toMaybe $ R.readRef ref
case mCb of
case mCb of
Nothing -> pure unit
Nothing -> pure unit
Just cb -> do
Just cb -> do
log2 "[loadedNgramsTableSpec] ngramsSelection" ngramsSelection
_ <- if allNgramsSelected || (Set.isEmpty ngramsSelection) then
_ <- if allNgramsSelected || (Set.isEmpty ngramsSelection) then
R2.setIndeterminateCheckbox cb false
R2.setIndeterminateCheckbox cb false
else
else
...
...
src/Gargantext/Utils/Reactix.purs
View file @
1aed5d91
...
@@ -307,7 +307,4 @@ focus nEl = case toMaybe nEl of
...
@@ -307,7 +307,4 @@ focus nEl = case toMaybe nEl of
Just el -> el ... "focus" $ []
Just el -> el ... "focus" $ []
setIndeterminateCheckbox :: R.Element -> Boolean -> Effect R.Element
setIndeterminateCheckbox :: R.Element -> Boolean -> Effect R.Element
setIndeterminateCheckbox el val = do
setIndeterminateCheckbox el val = pure $ (el .= "indeterminate") val
log2 "[setIntederminateCheckbox] el" el
log2 "[setIntederminateCheckbox] val" val
pure $ (el .= "indeterminate") val
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