Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

fix for setting input validation result [fixes #83652602] #100

Merged
merged 1 commit into from
Dec 9, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/components/inputs/inputview.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,9 @@ module.exports = class KDInputView extends KDView
for rule in @ruleChain
@validationResults[rule] = null


setValidationResult:(rule, err, showNotification=yes)->

if err
@validationResults[rule] = err
@showValidationError err if @getOptions().validate.notifications and showNotification
Expand All @@ -328,9 +330,12 @@ module.exports = class KDInputView extends KDView
@validationResults[rule] = null
# if there is any true on validation results' values then is not valid

@valid = not (v for own k, v of @validationResults)
.map((result)-> Boolean result)
.indexOf(true) > -1
@valid = not(
(v for own k, v of @validationResults)
.map((result)-> Boolean result)
.indexOf(true) > -1
)


showValidationError:(message)->

Expand Down