diff options
author | liuxiaodong <lxdong.007@gmail.com> | 2019-02-16 00:43:22 +0800 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-02-15 17:43:22 +0100 |
commit | 2610b16f6ede15888de9769b7226233dc8e86b68 (patch) | |
tree | bbaaaaac0e21b3a033c0dcf535efaf489eb9f609 | |
parent | bb9fe2046e6b1d2b3190f466d53b22f6785c8433 (diff) | |
download | Nim-2610b16f6ede15888de9769b7226233dc8e86b68.tar.gz |
some dom proc correction and complement (#10684)
-rw-r--r-- | lib/js/dom.nim | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/js/dom.nim b/lib/js/dom.nim index 9d6cd9152..3c6d65d8a 100644 --- a/lib/js/dom.nim +++ b/lib/js/dom.nim @@ -192,7 +192,7 @@ type Element* = ref ElementObj ElementObj {.importc.} = object of NodeObj - classList*: Classlist + classList*: ClassList checked*: bool defaultChecked*: bool defaultValue*: cstring @@ -1183,9 +1183,10 @@ proc contains*(c: ClassList, class: cstring): bool proc toggle*(c: ClassList, class: cstring) # Style "methods" -proc getAttribute*(s: Style, attr: cstring, caseSensitive=false): cstring -proc removeAttribute*(s: Style, attr: cstring, caseSensitive=false) -proc setAttribute*(s: Style, attr, value: cstring, caseSensitive=false) +proc getPropertyValue*(s: Style, property: cstring): cstring +proc removeProperty*(s: Style, property: cstring) +proc setProperty*(s: Style, property, value: cstring, priority = "") +proc getPropertyPriority*(s: Style, property: cstring): cstring # Event "methods" proc preventDefault*(ev: Event) @@ -1267,6 +1268,10 @@ proc inViewport*(el: Node): bool = rect.right <= clientWidth().float proc scrollTop*(e: Node): int {.importcpp: "#.scrollTop", nodecl.} +proc scrollLeft*(e: Node): int {.importcpp: "#.scrollLeft", nodecl.} +proc scrollHeight*(e: Node): int {.importcpp: "#.scrollHeight", nodecl.} +proc scrollWidth*(e: Node): int {.importcpp: "#.scrollWidth", nodecl.} proc offsetHeight*(e: Node): int {.importcpp: "#.offsetHeight", nodecl.} +proc offsetWidth*(e: Node): int {.importcpp: "#.offsetWidth", nodecl.} proc offsetTop*(e: Node): int {.importcpp: "#.offsetTop", nodecl.} proc offsetLeft*(e: Node): int {.importcpp: "#.offsetLeft", nodecl.} |