Comparing version 0.1.1 to 0.1.2
@@ -52,6 +52,7 @@ | ||
Form.prototype.render = function () { | ||
Form.prototype.render = function (callback) { | ||
var content = '', | ||
tag; | ||
tag, | ||
html; | ||
@@ -64,4 +65,10 @@ for (var i = 0; i < this.elements.length; i++) { | ||
return this.options.theme.form(tag.render(), this); | ||
html = this.options.theme.form(tag.render(), this); | ||
if (callback) { | ||
return callback(html); | ||
} | ||
return html; | ||
}; | ||
@@ -68,0 +75,0 @@ |
{ | ||
"name": "formist", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "A library to publish, consume and validate HTML5 forms.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -87,2 +87,21 @@ | ||
it('synchronously', function () { | ||
var form = new formist.Form(); | ||
expect(form.render()).to.equal('<form></form>'); | ||
}); | ||
it('asynchronously', function (done) { | ||
var form = new formist.Form(); | ||
form.render(function (html) { | ||
expect(html).to.equal('<form></form>'); | ||
return done() | ||
}); | ||
}); | ||
it('an empty form', function () { | ||
@@ -89,0 +108,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45432
1076