on master help sign in
Simplify the Input API for basic widgets.
commit706d706e3fa6635688f7a1da6334881cabe65cfc authorevancz <info@elm-lang.org> dateFri 17 May 2013, 23:00 (13 years ago) parent8823b01
2 files changed+6−10
libraries/Graphics/Input.elm+6−6 libraries/Native/Signal/Input.js−4
libraries/Graphics/Input.elm+6−6
@@ -35,19 +35,19 @@ fields : a -> { field : (FieldState -> a) -> String -> FieldState -> Element,
3535
3636empty = { string="", start=0, end=0 }
3737
38−field : String -> (Signal Element, Signal FieldState)
38+field : String -> (Signal Element, Signal String)
3939field placeHolder =
4040 let tfs = N.fields empty
41− in (lift (tfs.field id placeHolder) tfs.events, tfs.events)
41+ in (lift (tfs.field id placeHolder) tfs.events, lift .string tfs.events)
4242
43−password : String -> (Signal Element, Signal FieldState)
43+password : String -> (Signal Element, Signal String)
4444password placeHolder =
4545 let tfs = N.passwords empty
46− in (lift (tfs.field id placeHolder) tfs.events, tfs.events)
46+ in (lift (tfs.field id placeHolder) tfs.events, lift .string tfs.events)
4747
48−email : String -> (Signal Element, Signal FieldState)
48+email : String -> (Signal Element, Signal String)
4949email placeHolder =
5050 let tfs = N.emails empty
51− in (lift (tfs.field id placeHolder) tfs.events, tfs.events)
51+ in (lift (tfs.field id placeHolder) tfs.events, lift .string tfs.events)
5252
5353-- file?
libraries/Native/Signal/Input.jsdeleted−4
@@ -1,4 +0,0 @@
1−
2−Elm.Native.Input = function(elm) {
3− return elm.Native.Input = {};
4−};