mirror of
https://github.com/byteverse/colonnade.git
synced 2026-02-22 11:07:53 +01:00
hide inactive rows
This commit is contained in:
parent
8c0faf9ae2
commit
eeaa05d2a2
@ -731,7 +731,7 @@ tableBodyExpandable colCount renderExpansion bodyAttrs trAttrs col collection a0
|
|||||||
let attrs = trAttrs a
|
let attrs = trAttrs a
|
||||||
expanded <- elDynAttr "tr" attrs (rowSizableReified (return False) (zipDynWith (||)) col a)
|
expanded <- elDynAttr "tr" attrs (rowSizableReified (return False) (zipDynWith (||)) col a)
|
||||||
visibleVal <- gateDynamic expanded a0 a
|
visibleVal <- gateDynamic expanded a0 a
|
||||||
elDynAttr "tr" attrs $ do
|
elDynAttr "tr" (zipDynWith insertVisibilityAttr expanded attrs) $ do
|
||||||
-- TODO: possibly provide a way to customize these attributes
|
-- TODO: possibly provide a way to customize these attributes
|
||||||
let expansionTdAttrs = pure M.empty
|
let expansionTdAttrs = pure M.empty
|
||||||
elDynAttr "td" (zipDynWith insertSizeAttr colCount expansionTdAttrs) (renderExpansion visibleVal)
|
elDynAttr "td" (zipDynWith insertSizeAttr colCount expansionTdAttrs) (renderExpansion visibleVal)
|
||||||
@ -783,6 +783,11 @@ rowSizable (E.Colonnade v) a = V.foldM (\m oc -> do
|
|||||||
return (mappend m e)
|
return (mappend m e)
|
||||||
) mempty v
|
) mempty v
|
||||||
|
|
||||||
|
insertVisibilityAttr :: Bool -> Map Text Text -> Map Text Text
|
||||||
|
insertVisibilityAttr b m = case b of
|
||||||
|
False -> M.insertWith T.append "style" "display:none;" m
|
||||||
|
True -> m
|
||||||
|
|
||||||
insertSizeAttr :: Int -> Map Text Text -> Map Text Text
|
insertSizeAttr :: Int -> Map Text Text -> Map Text Text
|
||||||
insertSizeAttr i m
|
insertSizeAttr i m
|
||||||
| i < 1 = M.insertWith T.append "style" "display:none;" m
|
| i < 1 = M.insertWith T.append "style" "display:none;" m
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user