Skip to content

Commit

Permalink
Merge pull request #3027 from ONLYOFFICE/fix/submit
Browse files Browse the repository at this point in the history
Sent onSubmit event when form is submitted successfully
  • Loading branch information
JuliaRadzhabova authored Jun 3, 2024
2 parents 57e509e + 9df2fd0 commit 2673afb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/api/documents/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@
'onRequestReferenceSource': <try to change source for external link>, // used for external links in sse. must call setReferenceSource method,
'onSaveDocument': 'save document from binary',
'onRequestStartFilling': <try to start filling forms> // used in pdf-form edit mode. must call startFilling method
'onSubmit': <filled form is submitted> // send when filled form is submitted successfully
}
}
Expand Down
4 changes: 4 additions & 0 deletions apps/common/Gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,10 @@ if (window.Common === undefined) {
}, data.buffer);
},

submitForm: function() {
_postMessage({event: 'onSubmit'});
},

on: function(event, handler){
var localHandler = function(event, data){
handler.call(me, data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ define([
this.view.btnSubmit.setDisabled(!_submitFail);
this.view.btnSubmit.cmpEl.css("pointer-events", "auto");
if (!_submitFail) {
Common.Gateway.submitForm();
this.view.btnSubmit.setCaption(this.textFilled);
this.view.btnSubmit.cmpEl.removeClass('yellow').removeClass('back-color').addClass('gray');
if (!this.submitedTooltip) {
Expand Down
1 change: 1 addition & 0 deletions apps/documenteditor/main/app/controller/FormsTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ define([
if (id==Asc.c_oAscAsyncAction['Submit'] && this.view.btnSubmit) {
Common.Utils.lockControls(Common.enumLock.submit, !this._submitFail, {array: [this.view.btnSubmit]})
if (!this._submitFail) {
Common.Gateway.submitForm();
this.view.btnSubmit.setCaption(this.view.textFilled);
if (!this.submitedTooltip) {
this.submitedTooltip = new Common.UI.SynchronizeTip({
Expand Down

0 comments on commit 2673afb

Please sign in to comment.