Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add toggle and beforetoggle events for the popover API. #806

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
===== dev =====
* Add support for the `toggle` and `beforetoggle` events of the `popover` API
** Also adds support for the `toggle` event for `details` elements

===== 11.1 =====
* Compatibility with WASM

Expand Down
2 changes: 2 additions & 0 deletions src/lib/eliom_content.client.mli
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ module Html : sig
val onreturn : ('a, Dom_html.keyboardEvent) ev_unit
val onchange : ('a, Dom_html.event) ev
val onchange_select : ('a, Dom_html.event) ev
val onbeforetoggle : ('a, Dom_html.toggleEvent) ev
val ontoggle : ('a, Dom_html.toggleEvent) ev
end

module Attr : sig
Expand Down
8 changes: 8 additions & 0 deletions src/lib/eliom_content_.client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,14 @@ module Html = struct
let onchange_select elt f =
let elt = get_unique_elt_select "Ev.onchange_select" elt in
elt##.onchange := bool_cb f

let onbeforetoggle elt f =
let elt = get_unique_elt "Ev.onbeforetoggle" elt in
elt##.onbeforetoggle := bool_cb f

let ontoggle elt f =
let elt = get_unique_elt "Ev.ontoggle" elt in
elt##.ontoggle := bool_cb f
end

module Attr = struct
Expand Down
2 changes: 2 additions & 0 deletions src/lib/eliom_content_core.client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ module Html = struct
let a_onabort s = A.Unsafe.string_attrib "onabort" s
let a_onafterprint s = A.Unsafe.string_attrib "onafterprint" s
let a_onbeforeprint s = A.Unsafe.string_attrib "onbeforeprint" s
let a_onbeforetoggle s = A.Unsafe.string_attrib "onbeforetoggle" s
let a_onbeforeunload s = A.Unsafe.string_attrib "onbeforeunload" s
let a_onblur s = A.Unsafe.string_attrib "onblur" s
let a_oncanplay s = A.Unsafe.string_attrib "oncanplay" s
Expand Down Expand Up @@ -393,6 +394,7 @@ module Html = struct
let a_onsubmit s = A.Unsafe.string_attrib "onsubmit" s
let a_onsuspend s = A.Unsafe.string_attrib "onsuspend" s
let a_ontimeupdate s = A.Unsafe.string_attrib "ontimeupdate" s
let a_ontoggle s = A.Unsafe.string_attrib "ontoggle" s
let a_onundo s = A.Unsafe.string_attrib "onundo" s
let a_onunload s = A.Unsafe.string_attrib "onunload" s
let a_onvolumechange s = A.Unsafe.string_attrib "onvolumechange" s
Expand Down
2 changes: 2 additions & 0 deletions src/lib/eliom_content_core.client.mli
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ module Html : sig
val a_onabort : string -> [> `OnAbort] A.attrib
val a_onafterprint : string -> [> `OnAfterPrint] A.attrib
val a_onbeforeprint : string -> [> `OnBeforePrint] A.attrib
val a_onbeforetoggle : string -> [> `OnBeforeToggle] A.attrib
val a_onbeforeunload : string -> [> `OnBeforeUnload] A.attrib
val a_onblur : string -> [> `OnBlur] A.attrib
val a_oncanplay : string -> [> `OnCanPlay] A.attrib
Expand Down Expand Up @@ -388,6 +389,7 @@ module Html : sig
val a_onsubmit : string -> [> `OnSubmit] A.attrib
val a_onsuspend : string -> [> `OnSuspend] A.attrib
val a_ontimeupdate : string -> [> `OnTimeUpdate] A.attrib
val a_ontoggle : string -> [> `OnToggle] A.attrib
val a_onundo : string -> [> `OnUndo] A.attrib
val a_onunload : string -> [> `OnUnload] A.attrib
val a_onvolumechange : string -> [> `OnVolumeChange] A.attrib
Expand Down
2 changes: 2 additions & 0 deletions src/lib/eliom_content_core.server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ module Html = struct
let a_onabort s = A.Unsafe.string_attrib "onabort" s
let a_onafterprint s = A.Unsafe.string_attrib "onafterprint" s
let a_onbeforeprint s = A.Unsafe.string_attrib "onbeforeprint" s
let a_onbeforetoggle s = A.Unsafe.string_attrib "onbeforetoggle" s
let a_onbeforeunload s = A.Unsafe.string_attrib "onbeforeunload" s
let a_onblur s = A.Unsafe.string_attrib "onblur" s
let a_oncanplay s = A.Unsafe.string_attrib "oncanplay" s
Expand Down Expand Up @@ -411,6 +412,7 @@ module Html = struct
let a_onsubmit s = A.Unsafe.string_attrib "onsubmit" s
let a_onsuspend s = A.Unsafe.string_attrib "onsuspend" s
let a_ontimeupdate s = A.Unsafe.string_attrib "ontimeupdate" s
let a_ontoggle s = A.Unsafe.string_attrib "ontoggle" s
let a_onundo s = A.Unsafe.string_attrib "onundo" s
let a_onunload s = A.Unsafe.string_attrib "onunload" s
let a_onvolumechange s = A.Unsafe.string_attrib "onvolumechange" s
Expand Down
2 changes: 2 additions & 0 deletions src/lib/eliom_content_core.server.mli
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ module Html : sig
val a_onabort : string -> [> `OnAbort] A.attrib
val a_onafterprint : string -> [> `OnAfterPrint] A.attrib
val a_onbeforeprint : string -> [> `OnBeforePrint] A.attrib
val a_onbeforetoggle : string -> [> `OnBeforeToggle] A.attrib
val a_onbeforeunload : string -> [> `OnBeforeUnload] A.attrib
val a_onblur : string -> [> `OnBlur] A.attrib
val a_oncanplay : string -> [> `OnCanPlay] A.attrib
Expand Down Expand Up @@ -256,6 +257,7 @@ module Html : sig
val a_onsubmit : string -> [> `OnSubmit] A.attrib
val a_onsuspend : string -> [> `OnSuspend] A.attrib
val a_ontimeupdate : string -> [> `OnTimeUpdate] A.attrib
val a_ontoggle : string -> [> `OnToggle] A.attrib
val a_onundo : string -> [> `OnUndo] A.attrib
val a_onunload : string -> [> `OnUnload] A.attrib
val a_onvolumechange : string -> [> `OnVolumeChange] A.attrib
Expand Down