on develop help sign in
Update Resize constraints
commitcbe10565f7a2e4701d9e024b86b0119f2876f8f0 authorLuigy Leon <luigy@outlook.com> dateMon 11 Jul 2016, 22:06 (10 years ago) parentf3e5825
1 file changed+5−3
src/Reflex/Dom/Widget/Resize.hs+5−3
src/Reflex/Dom/Widget/Resize.hs+5−3
@@ -4,12 +4,14 @@ module Reflex.Dom.Widget.Resize where
44import Reflex
55import Reflex.Dom.PostBuild.Class
66import Reflex.Dom.PerformEvent.Class
7+import Reflex.Dom.Builder.Class
78import Reflex.Dom.Builder.Immediate
89import Reflex.Dom.Class
910import Reflex.Dom.Old
1011import Reflex.Dom.Widget.Basic
1112
1213import Control.Monad
14+import Control.Monad.Fix
1315import Control.Monad.IO.Class
1416import Data.Map (Map)
1517import Data.Text (Text)
@@ -21,16 +23,16 @@ import qualified Data.Map as Map
2123
2224-- | A widget that wraps the given widget in a div and fires an event when resized.
2325-- Adapted from github.com/marcj/css-element-queries
24−resizeDetector :: MonadWidget t m => m a -> m (Event t (), a)
26+resizeDetector :: (DomBuilder t m, PostBuild t m, TriggerEvent t m, PerformEvent t m, MonadHold t m, DomBuilderSpace m ~ GhcjsDomSpace, MonadIO (Performable m), MonadIO m, MonadFix m) => m a -> m (Event t (), a)
2527resizeDetector = resizeDetectorWithStyle ""
2628
27−resizeDetectorWithStyle :: MonadWidget t m
29+resizeDetectorWithStyle :: (DomBuilder t m, PostBuild t m, TriggerEvent t m, PerformEvent t m, MonadHold t m, DomBuilderSpace m ~ GhcjsDomSpace, MonadIO (Performable m), MonadIO m, MonadFix m)
2830 => Text -- ^ A css style string. Warning: It should not contain the "position" style attribute.
2931 -> m a -- ^ The embedded widget
3032 -> m (Event t (), a) -- ^ An 'Event' that fires on resize, and the result of the embedded widget
3133resizeDetectorWithStyle styleString w = resizeDetectorWithAttrs ("style" =: styleString) w
3234
33−resizeDetectorWithAttrs :: MonadWidget t m
35+resizeDetectorWithAttrs :: (DomBuilder t m, PostBuild t m, TriggerEvent t m, PerformEvent t m, MonadHold t m, DomBuilderSpace m ~ GhcjsDomSpace, MonadIO (Performable m), MonadIO m, MonadFix m)
3436 => Map Text Text -- ^ A map of attributes. Warning: It should not modify the "position" style attribute.
3537 -> m a -- ^ The embedded widget
3638 -> m (Event t (), a) -- ^ An 'Event' that fires on resize, and the result of the embedded widget