-
Notifications
You must be signed in to change notification settings - Fork 194
[draft] Implement the popover
API.
#1734
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -569,6 +569,10 @@ and eventTarget = object ('self) | |
|
||
method onpointerup : ('self t, pointerEvent t) event_listener writeonly_prop | ||
|
||
method onbeforetoggle : ('self t, toggleEvent t) event_listener writeonly_prop | ||
|
||
method ontoggle : ('self t, toggleEvent t) event_listener writeonly_prop | ||
|
||
method dispatchEvent : event t -> bool t meth | ||
end | ||
|
||
|
@@ -747,6 +751,8 @@ and element = object | |
|
||
method scrollHeight : int prop | ||
|
||
method popover : js_string t opt prop | ||
|
||
method getClientRects : clientRectList t meth | ||
|
||
method getBoundingClientRect : clientRect t meth | ||
|
@@ -759,6 +765,18 @@ and element = object | |
|
||
method blur : unit meth | ||
|
||
method hidePopover : unit meth | ||
|
||
method showPopover : unit meth | ||
|
||
method showPopover_options : _ -> unit meth | ||
|
||
method togglePopover : bool t meth | ||
|
||
method togglePopover_force : bool t -> bool t meth | ||
|
||
method togglePopover_options : _ -> bool t meth | ||
|
||
Comment on lines
+770
to
+779
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the specs, these methods accept a dictionary as a parameter for passing options. How would that be reflected in Js_of_ocaml? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there is an example in lib/js_of_ocaml/eventSource.ml |
||
inherit eventTarget | ||
end | ||
|
||
|
@@ -979,6 +997,8 @@ module Event = struct | |
|
||
let waiting = Dom.Event.make "waiting" | ||
|
||
let beforetoggle = Dom.Event.make "beforetoggle" | ||
|
||
let toggle = Dom.Event.make "toggle" | ||
|
||
let make = Dom.Event.make | ||
|
@@ -1209,6 +1229,10 @@ class type inputElement = object ('self) | |
|
||
method selectionEnd : int prop | ||
|
||
method popovertarget : element t opt prop | ||
|
||
method popovertargetaction : js_string t prop | ||
|
||
method onselect : ('self t, event t) event_listener prop | ||
|
||
method onchange : ('self t, event t) event_listener prop | ||
|
@@ -1284,6 +1308,10 @@ class type buttonElement = object | |
method _type : js_string t readonly_prop | ||
|
||
method value : js_string t prop | ||
|
||
method popovertarget : element t opt prop | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be |
||
|
||
method popovertargetaction : js_string t prop | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be |
||
end | ||
|
||
class type labelElement = object | ||
|
@@ -1400,8 +1428,6 @@ class type detailsElement = object ('self) | |
method open_ : bool t prop | ||
|
||
method name : js_string t prop | ||
|
||
method ontoggle : ('self t, toggleEvent t) event_listener prop | ||
end | ||
|
||
class type imageElement = object ('self) | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are similar methods related to event handlers in this file that have the
prop
type instead ofwriteonly_prop
. In fact, theontoggle
method initially used the former type. Is this new version correct?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
writeonly_prop is often used for situation where the property might be undefined.