assets/js/romo/form.js in romo-0.16.2 vs assets/js/romo/form.js in romo-0.17.0
- old
+ new
@@ -64,15 +64,17 @@
}
RomoForm.prototype.onFormKeyPress = function(e) {
if (this.elem.data('romo-form-disable-keypress') !== true) {
- var target = $(e.target);
-
- if (target.is(':not(TEXTAREA)') && e.keyCode === 13 /* Enter */) {
+ var targetElem = $(e.target);
+ if (targetElem.is(':not(TEXTAREA)') && e.keyCode === 13 /* Enter */) {
e.preventDefault();
- this.onSubmitClick();
+ if (this.elem.data('romo-form-disable-enter-submit') !== true &&
+ targetElem.data('romo-form-disable-enter-submit') !== true) {
+ this.onSubmitClick();
+ }
}
}
}
RomoForm.prototype.onSubmitClick = function(e) {
@@ -207,12 +209,10 @@
return prev;
}, {});
}
RomoForm.prototype._getListValueInputNamesDelims = function() {
- return $.map(this.elem.find('[data-romo-form-list-values="true"]'), function(item){
- return item; // converts the collection to an array
- }).reduce($.proxy(function(prev, curr) {
+ return Romo.toArray(this.elem.find('[data-romo-form-list-values="true"]')).reduce($.proxy(function(prev, curr) {
prev[$(curr).attr('name')] = $(curr).data('romo-form-list-values-delim') || this.defaultListValuesDelim;
return prev;
}, this), {});
}