on develop help sign in
Add elClass
1675465Doug Beardsley
src/Reflex/Dom/Widget/Basic.hs+4−1
@@ -338,6 +338,9 @@ elDynAttr elementTag attrs child = do
338el :: forall t m a. MonadWidget t m => String -> m a -> m a
338el :: forall t m a. MonadWidget t m => String -> m a -> m a
339el tag child = elAttr tag Map.empty child
339el tag child = elAttr tag Map.empty child
340
340
341+elClass :: forall t m a. MonadWidget t m => String -> String -> m a -> m a
342+elClass tag c child = elAttr tag ("class" =: c) child
343+
341--------------------------------------------------------------------------------
344--------------------------------------------------------------------------------
342-- Copied and pasted from Reflex.Widget.Class
345-- Copied and pasted from Reflex.Widget.Class
343--------------------------------------------------------------------------------
346--------------------------------------------------------------------------------
@@ -382,7 +385,7 @@ workflowView w0 = do
382 return $ fmap fst eResult
385 return $ fmap fst eResult
383
386
384divClass :: forall t m a. MonadWidget t m => String -> m a -> m a
387divClass :: forall t m a. MonadWidget t m => String -> m a -> m a
385−divClass = elAttr "div" . Map.singleton "class"
388+divClass = elClass "div"
386
389
387dtdd :: forall t m a. MonadWidget t m => String -> m a -> m a
390dtdd :: forall t m a. MonadWidget t m => String -> m a -> m a
388dtdd h w = do
391dtdd h w = do