added toChecked and toDisabled helpers
This commit is contained in:
parent
9a8b020269
commit
6bd32a0e88
2 changed files with 6 additions and 3 deletions
|
|
@ -71,9 +71,6 @@ proc clearCompleted(ev: Event, n: VNode) =
|
|||
proc toClass(completed: bool): cstring =
|
||||
(if completed: cstring"completed" else: cstring(nil))
|
||||
|
||||
proc toChecked(checked: bool): cstring =
|
||||
(if checked: cstring"checked" else: cstring(nil))
|
||||
|
||||
proc selected(v: Filter): cstring =
|
||||
(if filter == v: cstring"selected" else: cstring(nil))
|
||||
|
||||
|
|
|
|||
|
|
@ -706,3 +706,9 @@ proc setInputText*(n: VNode; s: cstring) =
|
|||
## Sets the text of input elements.
|
||||
n.text = s
|
||||
if n.dom != nil: n.dom.value = s
|
||||
|
||||
proc toChecked*(checked: bool): cstring =
|
||||
(if checked: cstring"checked" else: cstring(nil))
|
||||
|
||||
proc toDisabled*(disabled: bool): cstring =
|
||||
(if disabled: cstring"disabled" else: cstring(nil))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue