Skip to content

Commit

Permalink
Lib: add submitEvent to Dom_html and update appropriate function sign…
Browse files Browse the repository at this point in the history
…atures (ocsigen#1077)
  • Loading branch information
pmwhite authored Dec 15, 2020
1 parent 28b4c20 commit 961d389
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ??? (??) - ??
## Features/Changes
* Lib: add submitEvent to Dom_html and update appropriate function signatures
* Compiler: complete support for OCaml 4.12
* Lib: expose API to attached and retrieve js errors to/from ocaml exceptions

Expand Down
9 changes: 8 additions & 1 deletion lib/js_of_ocaml/dom_html.ml
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,13 @@ and touch =
method pageY : int readonly_prop
end

and submitEvent =
object
inherit event

method submitter : element t optdef readonly_prop
end

and dragEvent =
object
inherit mouseEvent
Expand Down Expand Up @@ -1011,7 +1018,7 @@ class type formElement =

method reset : unit meth

method onsubmit : ('self t, event t) event_listener writeonly_prop
method onsubmit : ('self t, submitEvent t) event_listener writeonly_prop
end

class type optGroupElement =
Expand Down
11 changes: 9 additions & 2 deletions lib/js_of_ocaml/dom_html.mli
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,13 @@ and touch =
method pageY : int readonly_prop
end

and submitEvent =
object
inherit event

method submitter : element t optdef readonly_prop
end

and dragEvent =
object
inherit mouseEvent
Expand Down Expand Up @@ -841,7 +848,7 @@ class type formElement =

method reset : unit meth

method onsubmit : ('self t, event t) event_listener writeonly_prop
method onsubmit : ('self t, submitEvent t) event_listener writeonly_prop
end

class type optGroupElement =
Expand Down Expand Up @@ -2333,7 +2340,7 @@ module Event : sig

val timeupdate : event t typ

val submit : event t typ
val submit : submitEvent t typ

val scroll : event t typ

Expand Down
2 changes: 1 addition & 1 deletion lib/lwt/lwt_js_events.mli
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ val submit :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
-> Dom_html.submitEvent Js.t Lwt.t

val select :
?use_capture:bool
Expand Down

0 comments on commit 961d389

Please sign in to comment.