assets/js/romo/form.js in romo-0.5.0 vs assets/js/romo/form.js in romo-0.6.0

- old
+ new

@@ -124,18 +124,25 @@ this.submitQueued = false; this.submitRunning = true; this.indicatorElems.trigger('indicator:triggerStart'); this.elem.trigger('form:beforeSubmit', [this]); - if (this.elem.attr('method').toUpperCase() === 'GET') { - this._doGetSubmit(); + if(this.elem.data('romo-form-browser-submit') === true) { + this._doBrowserSubmit(); + } else if (this.elem.attr('method').toUpperCase() === 'GET') { + this._doNonBrowserGetSubmit(); } else { - this._doNonGetSubmit(); + this._doNonBrowserNonGetSubmit(); } } -RomoForm.prototype._doGetSubmit = function() { +RomoForm.prototype._doBrowserSubmit = function() { + this.elem.submit(); + this.elem.trigger('form:browserSubmit', [this]); +} + +RomoForm.prototype._doNonBrowserGetSubmit = function() { var data = this._getSerializeObj(); if (this.elem.data('romo-form-redirect-page') === true) { var paramString = Romo.param(data, { removeEmpty: this.removeEmptyGetParams, @@ -150,10 +157,10 @@ } else { this._doAjaxSubmit(data, true); } } -RomoForm.prototype._doNonGetSubmit = function() { +RomoForm.prototype._doNonBrowserNonGetSubmit = function() { this._doAjaxSubmit(this._getFormData(), false); } RomoForm.prototype._doAjaxSubmit = function(data, process) { $.ajax({