removed the need to call karax.init explicitly
This commit is contained in:
parent
d9bb8d99e8
commit
5bc7d4e336
5 changed files with 9 additions and 20 deletions
|
|
@ -112,14 +112,11 @@ var
|
|||
dorender: proc (): VNode {.closure.}
|
||||
currentTree: VNode
|
||||
|
||||
proc setRenderer*(renderer: proc (): VNode) =
|
||||
dorender = renderer
|
||||
|
||||
proc setTimeout*(action: proc(); ms: int): Timeout {.importc, nodecl.}
|
||||
proc clearTimeout*(t: Timeout) {.importc, nodecl.}
|
||||
#proc targetElem*(e: Event): Element = cast[Element](e.target)
|
||||
|
||||
proc getElementById*(id: cstring): Element {.importc: "document.getElementById", nodecl.}
|
||||
proc getElementById(id: cstring): Element {.importc: "document.getElementById", nodecl.}
|
||||
|
||||
#proc getElementsByClassName*(cls: cstring): seq[Element] {.importc:
|
||||
# "document.getElementsByClassName", nodecl.}
|
||||
|
|
@ -259,9 +256,13 @@ proc redraw*() =
|
|||
else:
|
||||
dodraw()
|
||||
|
||||
proc init*() =
|
||||
proc init(ev: Event) =
|
||||
reqFrame(dodraw)
|
||||
|
||||
proc setRenderer*(renderer: proc (): VNode) =
|
||||
dorender = renderer
|
||||
window.onload = init
|
||||
|
||||
proc scrollTop*(e: Node): int {.importcpp: "#.scrollTop", nodecl.}
|
||||
proc offsetHeight*(e: Node): int {.importcpp: "#.offsetHeight", nodecl.}
|
||||
proc offsetTop*(e: Node): int {.importcpp: "#.offsetTop", nodecl.}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue