app/assets/javascripts/bhf/classes/ArrayFields.js in bhf-0.10.12 vs app/assets/javascripts/bhf/classes/ArrayFields.js in bhf-0.10.13
- old
+ new
@@ -7,11 +7,11 @@
if ( ! _object) { return; }
// this.setOptions(_options);
var elem = _object;
var template = elem.getElement('.array_fields').clone();
var currentNr = 0;
-
+
new Element('span.plus_button.qe_button.default_form_align', {text: '+'})
.inject(elem)
.addEvent('click', function(e){
var holder = template.clone();
var newInput = (holder.getElement('input') || holder).erase('value');
@@ -24,16 +24,16 @@
);
}
holder.inject(e.target, 'before');
window.fireEvent('bhfDomChunkReady', [holder]);
});
-
+
elem.getParent('form').addEvent('submit', function(){
elem.getElements('.array_fields').each(function(fieldElem){
var input = (fieldElem.getElement('input') || fieldElem);
if (input.value) { return; }
input.erase('name');
});
return true;
});
}
-});
\ No newline at end of file
+});