@@ -352,6 +352,13 @@ elClass tag c child = elAttr tag ("class" =: c) child
353list dm mkChild = listWithKey dm (\_ dv -> mkChild dv)
353list dm mkChild = listWithKey dm (\_ dv -> mkChild dv)
355+elDynHtml' :: MonadWidget t m => String -> Dynamic t String -> m (El t)
356+elDynHtml' elementTag html = do
357+ e <- buildEmptyElement elementTag (Map.empty :: Map String String)
358+ schedulePostBuild $ liftIO . htmlElementSetInnerHTML e =<< sample (current html)
359+ addVoidAction $ fmap (liftIO . htmlElementSetInnerHTML e) $ updated html
357--TODO: Update dynamically
364--TODO: Update dynamically
@@ -434,4 +441,9 @@ tabDisplay ulClass activeClass tabItems = do
434 a <- link x
441 a <- link x
435 return $ fmap (const k) (_link_clicked a)
442 return $ fmap (const k) (_link_clicked a)
437−
444+-- | Place an element into the DOM and wrap it with Reflex event handlers. Note: undefined behavior may result if the element is placed multiple times, removed from the DOM after being placed, or in other situations. Don't use this unless you understand the internals of MonadWidget.
445+unsafePlaceElement :: MonadWidget t m => HTMLElement -> m (El t)
446+unsafePlaceElement e = do
448+ liftIO $ nodeAppendChild p $ Just e