+5
-1
| var Tag = require('./tag'), | ||
| var clone = require('clone'), | ||
| Tag = require('./tag'), | ||
| contentTags = ['button','textarea','select']; | ||
@@ -40,2 +41,5 @@ | ||
| // clone the options, so we don't mess with objects passed in | ||
| this.options.options = clone(this.options.options); | ||
| for (var i = 0; i < this.options.options.length; i++) { | ||
@@ -42,0 +46,0 @@ |
+4
-1
| { | ||
| "name": "formist", | ||
| "version": "0.1.7", | ||
| "version": "0.1.8", | ||
| "description": "A library to publish, consume and validate HTML5 forms.", | ||
@@ -26,3 +26,6 @@ "main": "index.js", | ||
| "chai": "1.9.1" | ||
| }, | ||
| "dependencies": { | ||
| "clone": "0.1.15" | ||
| } | ||
| } |
+16
-0
@@ -516,2 +516,18 @@ | ||
| it("without altering original object", function () { | ||
| var opts = [{label:'Australia',value:'a'},{label:'UK',value:'uk'},{label:'US',value:'us'}]; | ||
| form.add(new formist.Field('select', { | ||
| options: opts, | ||
| value: 'a' | ||
| })); | ||
| // render the form | ||
| form.render(); | ||
| expect(opts[0]).to.not.have.property('attributes'); | ||
| }); | ||
| }); | ||
@@ -518,0 +534,0 @@ |
54326
1.05%1362
0.96%1
Infinity%+ Added
+ Added