Skip to content

Instantly share code, notes, and snippets.

@Rizary
Created August 13, 2018 09:01
Show Gist options
  • Save Rizary/7532b028454d1e0753deb575db81716e to your computer and use it in GitHub Desktop.
Save Rizary/7532b028454d1e0753deb575db81716e to your computer and use it in GitHub Desktop.
navbarBurger :: forall t m. MonadWidget t m
=> T.Text
-> T.Text
-> m ()
navbarBurger elm dataTarget = do
rec
let
dynAttrs = fmap (\s -> if s then Map.fromList [("class","navbar-burger is-active"), ("data-target",dataTarget)]
else Map.fromList [("class","navbar-burger"), ("data-target",dataTarget)])
(ev1,_) <- elDynAttr' elm dynAttrs $ pure ()
click <- holdDyn False $ True <$ domEvent Click ev1
return ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment