assets/js/romo/form.js in romo-0.14.3 vs assets/js/romo/form.js in romo-0.14.4

- old
+ new

@@ -4,11 +4,11 @@ }); } var RomoForm = function(element, givenSubmitElement, givenIndicatorElements) { this.elem = $(element); - this.defaultSubmitElem = this.elem.find('button[type="submit"], input[type="submit"], [data-romo-form-submit="true"]'); + this.defaultSubmitElem = this.elem.find('button[type="submit"], input[type="submit"], [data-romo-form-submit]'); this.submitElem = $(givenSubmitElement || this.defaultSubmitElem); this.defaultIndicatorElems = this.elem.find('[data-romo-indicator-auto="true"]'); this.indicatorElems = $(givenIndicatorElements || this.defaultIndicatorElems); this.changeSubmitElems = this.elem.find('[data-romo-form-change-submit="true"]'); this.onkeySubmitElems = this.elem.find('[data-romo-form-onkey-submit="true"]'); @@ -78,10 +78,12 @@ RomoForm.prototype.onSubmitClick = function(e) { if (e !== undefined) { e.preventDefault(); } - if (this.submitElem.hasClass('disabled') === false) { + if (this.submitElem.data('romo-form-submit') === 'confirm') { + this.elem.trigger('form:confirmSubmit', [this]); + } else if (this.submitElem.hasClass('disabled') === false) { this.doSubmit(); } } RomoForm.prototype.doSubmit = function() {