Minor cleanup
This commit is contained in:
parent
d9335ee0f0
commit
918cda96cf
1 changed files with 20 additions and 18 deletions
|
|
@ -24,7 +24,8 @@ when defined(js):
|
||||||
name.strip().replace(" ", "-").toLowerAscii
|
name.strip().replace(" ", "-").toLowerAscii
|
||||||
|
|
||||||
proc onCategoryLoad(state: CategoryPicker): proc (httpStatus: int, response: kstring) =
|
proc onCategoryLoad(state: CategoryPicker): proc (httpStatus: int, response: kstring) =
|
||||||
return proc (httpStatus: int, response: kstring) =
|
return
|
||||||
|
proc (httpStatus: int, response: kstring) =
|
||||||
state.loading = false
|
state.loading = false
|
||||||
state.status = httpStatus.HttpCode
|
state.status = httpStatus.HttpCode
|
||||||
if state.status != Http200: return
|
if state.status != Http200: return
|
||||||
|
|
@ -81,7 +82,8 @@ when defined(js):
|
||||||
proc onCategoryClick(state: CategoryPicker, category: Category): proc (ev: Event, n: VNode) =
|
proc onCategoryClick(state: CategoryPicker, category: Category): proc (ev: Event, n: VNode) =
|
||||||
# this is necessary to capture the right value
|
# this is necessary to capture the right value
|
||||||
let cat = category
|
let cat = category
|
||||||
return proc (ev: Event, n: VNode) =
|
return
|
||||||
|
proc (ev: Event, n: VNode) =
|
||||||
let oldCategory = state[state.selectedCategoryID]
|
let oldCategory = state[state.selectedCategoryID]
|
||||||
state.select(cat.id)
|
state.select(cat.id)
|
||||||
state.onCategoryChange(oldCategory, cat)
|
state.onCategoryChange(oldCategory, cat)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue