on master help sign in
Add some documentation
b23ff22Evan Czaplicki
libraries/Graphics/Input.elm+4
@@ -75,10 +75,14 @@ checkbox b =
75 let cbs = checkboxes b
75 let cbs = checkboxes b
76 in (lift (cbs.checkbox id) cbs.events, cbs.events)
76 in (lift (cbs.checkbox id) cbs.events, cbs.events)
77
77
78+-- Detect when the mouse is hovering over some elements. This
79+-- allows you to create and destroy elements dynamically and still
80+-- detect hover information.
78hoverables : a -> { events : Signal a,
81hoverables : a -> { events : Signal a,
79 hoverable : (Bool -> a) -> Element -> Element }
82 hoverable : (Bool -> a) -> Element -> Element }
80hoverables = Native.Graphics.Input.hoverables
83hoverables = Native.Graphics.Input.hoverables
81
84
85+-- Detect when the mouse is hovering over a specifici `Element`.
82hoverable : Element -> (Element, Signal Bool)
86hoverable : Element -> (Element, Signal Bool)
83hoverable elem =
87hoverable elem =
84 let pool = hoverables False
88 let pool = hoverables False