Nikky
02/01/2021, 11:28 AMloads
event workaround whenver i need to get something loaded once the dom is ready
seems like the browser does not give you any callback for once a specific domElement is constructed.. only the whole dom at once
div("mountpoint", id = "map-mountpoint"){
img(id = "map-loading-screen") {
// there nees to be something to load for the event to fire
src("<https://images.squarespace-cdn.com/content/v1/571fc5edd210b89083925aba/1538386611004-KSNMFIBVFZVLZ87ZG2Y8/ke17ZwdGBToddI8pDm48kCAcKCAp1mJfKUNHInBbGg57gQa3H78H3Y0txjaiv_0fDoOvxcdMmMKkDsyUqMSsMWxHk725yiiHCCLfrh8O1z5QPOohDIaIeljMHgDF5CVlOqpeNLcJ80NK65_fV7S1USLl2-GtoEZOTuQCER9og-NsW-mZEHbjAwvLbYwUUwze4mIkeL7oL2X-WUQoOqRAoA/ShibuyaRiver.jpg?format=2500w>")
loads.map { event: Event ->
console.log("node:", domNode)
console.log("event:", event)
console.log("parent:", domNode.parentElement) // do something with this
domNode.remove() // remove the image
}.watch()
}
}
i doubt that fritz could make ths much prettier or easier to use but i hope it will anyways