stop showing rows for invalid columns

This commit is contained in:
Andrew Martin 2018-12-07 11:13:44 -05:00
parent 11ced47370
commit fa682cbfdc
No known key found for this signature in database
GPG Key ID: 4FEE56C538F773B4

View File

@ -671,7 +671,7 @@ expandablePreloaded (Bureau tableAttrs (E.Headed (theadAttrs,theadRowAttrs)) bod
vlen = V.length v vlen = V.length v
buildRow :: Dynamic t a -> Dynamic t Bool -> m (Event t e) buildRow :: Dynamic t a -> Dynamic t Bool -> m (Event t e)
buildRow a visible = do buildRow a visible = do
elist <- el "tr" $ E.rowMonadicWith [] (++) colonnade (fmap (\k -> [k]) . el "td") a elist <- elDynAttr "tr" (fmap (bool hidden M.empty) visible) $ E.rowMonadicWith [] (++) colonnade (fmap (\k -> [k]) . el "td") a
let b = leftmost (map fst elist) let b = leftmost (map fst elist)
let e = map snd elist let e = map snd elist
shouldDisplay1 <- foldDyn const False b shouldDisplay1 <- foldDyn const False b
@ -679,12 +679,14 @@ expandablePreloaded (Bureau tableAttrs (E.Headed (theadAttrs,theadRowAttrs)) bod
el "tr" $ do el "tr" $ do
let attrs = fmap let attrs = fmap
( bool ( bool
(M.fromList [("style","display:none;")]) hidden
(M.fromList [("colspan",T.pack (show vlen))]) (M.fromList [("colspan",T.pack (show vlen))])
) shouldDisplay2 ) shouldDisplay2
elDynAttr "td" attrs (f a) elDynAttr "td" attrs (f a)
pure (mconcat e) pure (mconcat e)
hidden :: Map Text Text
hidden = M.singleton "style" "display:none;"
-- | Table with cells that can create expanded content -- | Table with cells that can create expanded content
-- between the rows. -- between the rows.