Skip to content

Commit

Permalink
Add value is function to input mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
sonechiman committed Mar 28, 2016
1 parent d94749f commit 14d0d57
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions dist/riot-form.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/riot-form.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/riot-form.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/riot-form.min.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion lib/form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export default class FormBuilder {
}

addNestedForm(form) {
assert(form.name, 'A form must have a name')
assert(form instanceof Form, 'A form must be instance of Form')
form.name = this._name + '.' + form.name
this._forms[form.name] = form
Expand Down
3 changes: 3 additions & 0 deletions lib/mixins/rf-input-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ riot.mixin('rf-input-helpers', {
getFormName: function () {
return this.opts.formName || this.opts.model.formName
},
valueIs: function (value) {
return this.opts.model.value === value
},
handleChange: function (e) {
this.assignValue(e.target.value)
},
Expand Down

0 comments on commit 14d0d57

Please sign in to comment.