package bonsai
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
A library for building dynamic webapps, using Js_of_ocaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
v0.17.0.tar.gz
sha256=c78c4476ee6b856846e2d0941e5965009d5e1b853e564b2b1bee61202f0b1ebb
doc/bonsai.web_ui_visibility/Bonsai_web_ui_visibility/index.html
Module Bonsai_web_ui_visibilitySource
Source
val only_when_visible :
?visible_attr:Bonsai_web.Vdom.Attr.t Bonsai_web.Value.t ->
?hidden_attr:Bonsai_web.Vdom.Attr.t Bonsai_web.Value.t ->
Bonsai_web.Vdom.Node.t Bonsai_web.Computation.t ->
Bonsai_web.Vdom.Node.t Bonsai_web.Computation.tonly_when_visible runs the provided computation for at least one frame initially, and then if the node is visible, will keep that computation active, but if it ever becomes hidden, the computation is deactivated and the most recent computed vdom node is returned instead. Upon becoming visible again, the computation is reactivated.
visible_attr and hidden_attr are optional attributes that will be attached to the dom nodes based on their visibility status.
Source
val only_when_visible' :
?visible_attr:Bonsai_web.Vdom.Attr.t Bonsai_web.Value.t ->
?hidden_attr:Bonsai_web.Vdom.Attr.t Bonsai_web.Value.t ->
(Bonsai_web.Vdom.Node.t * 'a) Bonsai_web.Computation.t ->
(Bonsai_web.Vdom.Node.t * 'a option) Bonsai_web.Computation.tLike only_when_visible, but if the component returns more than just a vdom node, you can propagate the value to the outside. This value is Some when the computation is active, and otherwise None.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>