Skip to content
This repository has been archived by the owner on Sep 9, 2019. It is now read-only.

Commit

Permalink
Bugfix [FormHandler.addField(field, {...opts}]: add subscribers to th…
Browse files Browse the repository at this point in the history
…e field
  • Loading branch information
Ivan Grimes committed Aug 26, 2018
1 parent 2a9ba37 commit 2009ab6
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 align="center"><img height="150" src="https://github.com/IvanGrimes/formhandler.js/blob/master/sandbox/logo.png?raw=true" /><br>FormHandler 1.1.1</h1>
<h1 align="center"><img height="150" src="https://github.com/IvanGrimes/formhandler.js/blob/master/sandbox/logo.png?raw=true" /><br>FormHandler 1.1.2</h1>

<p align="center">
<a href="https://travis-ci.org/IvanGrimes/formhandler.js">
Expand Down
1 change: 1 addition & 0 deletions build/js/formhandler.js

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

2 changes: 1 addition & 1 deletion build/js/formhandler.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/js/FormHandler.esm.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,7 @@ function () {
notice: noticeOptions
});
this.makeField(name, this.opts.fields[name]);
this.fields[name].on(INPUT, this.inputHandler);
this.makeNotice(name, this.opts.fields[name].notice);
return this.fields[name].node;
}
Expand Down
1 change: 1 addition & 0 deletions dist/js/FormHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,7 @@
notice: noticeOptions
});
this.makeField(name, this.opts.fields[name]);
this.fields[name].on(INPUT, this.inputHandler);
this.makeNotice(name, this.opts.fields[name].notice);
return this.fields[name].node;
}
Expand Down
4 changes: 2 additions & 2 deletions dist/js/FormHandler.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/FormHandler.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "formhandler.js",
"version": "1.1.1",
"version": "1.1.2",
"description": "Powerful pure Javascript form validator with a feature of adding your own validations",
"author": "Ivan Grimes",
"license": "MIT",
Expand Down
8 changes: 8 additions & 0 deletions sandbox/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,11 @@ const form = new FormHandler({
});

form.validateField('email');
form.addField('message2', {
validation: 'isNonEmpty',
min: 12,
max: 48,
notice: {
message: 'This fields was added from method',
},
})
2 changes: 2 additions & 0 deletions src/js/FormHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,8 @@ export default class FormHandler { // TODO: Переименовать опци
};

this.makeField(name, this.opts.fields[name]);
this.fields[name].on(INPUT, this.inputHandler);

this.makeNotice(name, this.opts.fields[name].notice);

return this.fields[name].node;
Expand Down

0 comments on commit 2009ab6

Please sign in to comment.