on develop help sign in
Add elClass
commit1675465634a128d3db2e78427949808534d13ccf authorDoug Beardsley <mightybyte@gmail.com> dateSat 28 Feb 2015, 19:45 (12 years ago) parent8e3bba9
1 file changed+4−1
src/Reflex/Dom/Widget/Basic.hs+4−1
src/Reflex/Dom/Widget/Basic.hs+4−1
@@ -338,6 +338,9 @@ elDynAttr elementTag attrs child = do
338338el :: forall t m a. MonadWidget t m => String -> m a -> m a
339339el tag child = elAttr tag Map.empty child
340340
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+
341344--------------------------------------------------------------------------------
342345-- Copied and pasted from Reflex.Widget.Class
343346--------------------------------------------------------------------------------
@@ -382,7 +385,7 @@ workflowView w0 = do
382385 return $ fmap fst eResult
383386
384387divClass :: forall t m a. MonadWidget t m => String -> m a -> m a
385−divClass = elAttr "div" . Map.singleton "class"
388+divClass = elClass "div"
386389
387390dtdd :: forall t m a. MonadWidget t m => String -> m a -> m a
388391dtdd h w = do