aboutsummaryrefslogtreecommitdiff
path: root/src/Lib/Dom
diff options
context:
space:
mode:
authorJoris2020-08-08 13:41:27 +0200
committerJoris2020-08-08 13:41:27 +0200
commit3e39f97d844dbe0ff5f57e3977bc220d366d4c0e (patch)
treebdbe9ab7a5659141f32c477002875796769471f1 /src/Lib/Dom
parent081e6aae57719c15bdbc5e973ca7ddba9506a4bb (diff)
Show icons in marker form
Diffstat (limited to 'src/Lib/Dom')
-rw-r--r--src/Lib/Dom/Element.ml9
-rw-r--r--src/Lib/Dom/Event.ml3
-rw-r--r--src/Lib/Dom/HE.ml2
3 files changed, 12 insertions, 2 deletions
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)