From 3e39f97d844dbe0ff5f57e3977bc220d366d4c0e Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 8 Aug 2020 13:41:27 +0200 Subject: Show icons in marker form --- src/Lib/Dom/Element.ml | 9 +++++++-- src/Lib/Dom/Event.ml | 3 +++ src/Lib/Dom/HE.ml | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src/Lib/Dom') diff --git a/src/Lib/Dom/Element.ml b/src/Lib/Dom/Element.ml index 391a95c..3c63ef4 100644 --- a/src/Lib/Dom/Element.ml +++ b/src/Lib/Dom/Element.ml @@ -1,10 +1,15 @@ -external set_value : Dom.element -> string -> unit = "value" [@@bs.set] +external set_value : Dom.element -> string -> unit = "value" + [@@bs.set] -external value : Dom.element -> string = "value" [@@bs.get] +external value : Dom.element -> string = "value" + [@@bs.get] external set_attribute : Dom.element -> string -> string -> unit = "setAttribute" [@@bs.send] +external set_class_name : Dom.element -> string -> unit = "className" + [@@bs.set] + external add_event_listener : Dom.element -> string -> (Dom.event -> unit) -> unit = "addEventListener" [@@bs.send] diff --git a/src/Lib/Dom/Event.ml b/src/Lib/Dom/Event.ml index 861afcf..9db46f0 100644 --- a/src/Lib/Dom/Event.ml +++ b/src/Lib/Dom/Event.ml @@ -1,6 +1,9 @@ external prevent_default : Dom.event -> unit = "preventDefault" [@@bs.send] +external stop_propagation : Dom.event -> unit = "stopPropagation" + [@@bs.send] + external target : Dom.event -> Dom.element = "target" [@@bs.get] diff --git a/src/Lib/Dom/HE.ml b/src/Lib/Dom/HE.ml index 098259a..c9aac16 100644 --- a/src/Lib/Dom/HE.ml +++ b/src/Lib/Dom/HE.ml @@ -5,3 +5,5 @@ let on_click f = H.EventAttr ("click", f) let on_input f = H.EventAttr ("input", f) let on_submit f = H.EventAttr ("submit", f) + +let on_blur f = H.EventAttr ("blur", f) -- cgit v1.2.3