diff options
author | Joris | 2021-05-13 14:50:51 +0200 |
---|---|---|
committer | Joris | 2021-05-13 14:58:26 +0200 |
commit | 221b6451fb4f8559a10e7fefebd13ce125ef29d0 (patch) | |
tree | 3ab337b7b2d40e8235f887046a580b0850540f11 /src/Dom/Element.ml | |
parent | 5c636f11cdfed82634ee572645d765b704941b68 (diff) |
Rewrite in TypeScript
BuckleScript is no longer maintained. Choose a widely used techno that
will still be maintained in the following years.
Diffstat (limited to 'src/Dom/Element.ml')
-rw-r--r-- | src/Dom/Element.ml | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/Dom/Element.ml b/src/Dom/Element.ml deleted file mode 100644 index 0b6c0bd..0000000 --- a/src/Dom/Element.ml +++ /dev/null @@ -1,44 +0,0 @@ -external setValue : Dom.element -> string -> unit = "value" [@@bs.set] - -external setTextContent : Dom.element -> string -> unit = "textContent" - [@@bs.set] - -external setStyle : Dom.element -> string -> unit = "style" [@@bs.set] - -external setClassName : Dom.element -> string -> unit = "className" [@@bs.set] - -external setScrollTop : Dom.element -> int -> unit = "scrollTop" [@@bs.set] - -external setAttribute : Dom.element -> string -> string -> unit = "setAttribute" - [@@bs.send] - -external setAttributeNS : Dom.element -> string -> string -> string -> unit - = "setAttributeNS" - [@@bs.send] - -external addEventListener : Dom.element -> string -> (Dom.event -> unit) -> unit - = "addEventListener" - [@@bs.send] - -external appendChild : Dom.element -> Dom.element -> unit = "appendChild" - [@@bs.send] - -external firstChild : Dom.element -> Dom.element Js.Nullable.t = "firstChild" - [@@bs.get] - -external removeChild : Dom.element -> Dom.element -> unit = "removeChild" - [@@bs.send] - -let removeFirstChild element = - match Js.toOption (firstChild element) with - | Some child -> - let () = removeChild element child in - true - | _ -> false - -let rec removeChildren element = - if removeFirstChild element then removeChildren element else () - -let mountOn base element = - let () = removeChildren base in - appendChild base element |