Commit 06b00c45 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[Forest]FIX] buttons && [Data.Array] splitEvery

parent b64eb3ad
......@@ -175,7 +175,8 @@ type NodePopupProps =
iconAStyle = { color : "black"
, paddingTop : "6px"
, paddingBottom : "6px"}
, paddingBottom : "6px"
}
nodePopupView :: (Action -> Aff Unit)
-> Record NodePopupProps
......@@ -258,11 +259,8 @@ nodePopupView d p mPop@(Just NodePopup /\ setPopupOpen) = R.createElement el p [
editIcon (true /\ _) = H.div {} []
panelBody nodePopupState d =
H.div {className: "panel-body"}
$
-- [H.div {className: "col-md-1"} []]
-- <>
[H.div {className: "flex-center"} (map (buttonClick nodePopupState d) buttons)]
H.div {className: "panel-body flex-center"}
$ map (buttonClick nodePopupState d) buttons
searchIsTexIframe id session search@(search' /\ _) =
if isIsTex search'.datafield then
......@@ -294,7 +292,7 @@ nodePopupView _ p _ = R.createElement el p []
-- buttonAction :: NodeAction -> R.Element
buttonClick (node@{action} /\ setNodePopup) _ todo = H.div {className: "col-md-2"}
buttonClick (node@{action} /\ setNodePopup) _ todo = H.div {className: "col-md-1"}
[ H.a { style: iconAStyle
, className: glyphiconActive (glyphiconNodeAction todo)
(action == (Just todo) )
......
module Gargantext.Data.Array
where
import Data.Tuple (Tuple(..))
import Data.Array as DA
import Data.Maybe as DM
import Data.Sequence as DS
splitEvery :: forall a. Int -> Array a -> Array (Array a)
splitEvery _ [] = []
splitEvery n xs =
let (Tuple h t) = splitAt n xs
in DA.cons h (splitEvery n t)
splitAt :: forall a. Int -> Array a -> Tuple (Array a) (Array a)
splitAt n ls = Tuple (DS.toUnfoldable x) (DS.toUnfoldable xs)
where
Tuple x xs = DS.splitAt n (DS.fromFoldable ls)
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