diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js index 8b1b602e3..5a7e4c7bc 100644 --- a/apps/documenteditor/main/app/controller/FormsTab.js +++ b/apps/documenteditor/main/app/controller/FormsTab.js @@ -70,6 +70,8 @@ define([ Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); this.api.asc_registerCallback('asc_onChangeSpecialFormsGlobalSettings', _.bind(this.onChangeSpecialFormsGlobalSettings, this)); Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); + this.api.asc_registerCallback('asc_onStartAction', _.bind(this.onLongActionBegin, this)); + this.api.asc_registerCallback('asc_onEndAction', _.bind(this.onLongActionEnd, this)); // this.api.asc_registerCallback('asc_onShowContentControlsActions',_.bind(this.onShowContentControlsActions, this)); // this.api.asc_registerCallback('asc_onHideContentControlsActions',_.bind(this.onHideContentControlsActions, this)); @@ -256,6 +258,29 @@ define([ } }, + onLongActionBegin: function(type, id) { + if (id==Asc.c_oAscAsyncAction['Submit'] && this.view.btnSubmit) { + this.view.btnSubmit.setDisabled(true); + } + }, + + onLongActionEnd: function(type, id) { + if (id==Asc.c_oAscAsyncAction['Submit'] && this.view.btnSubmit) { + this.view.btnSubmit.setDisabled(false); + if (!this.submitedTooltip) { + this.submitedTooltip = new Common.UI.SynchronizeTip({ + text: this.view.textSubmited, + extCls: 'no-arrow', + target: $(document.body) + }); + this.submitedTooltip.on('closeclick', function () { + this.submitedTooltip.hide(); + }, this); + } + this.submitedTooltip.show(); + } + }, + onAppReady: function (config) { var me = this; (new Promise(function (accept, reject) { diff --git a/apps/documenteditor/main/app/view/FormsTab.js b/apps/documenteditor/main/app/view/FormsTab.js index 1e7dcc883..8b0c8a7b0 100644 --- a/apps/documenteditor/main/app/view/FormsTab.js +++ b/apps/documenteditor/main/app/view/FormsTab.js @@ -386,7 +386,8 @@ define([ capBtnSubmit: 'Submit', tipPrevForm: 'Go to the previous field', tipNextForm: 'Go to the next field', - tipSubmit: 'Submit form' + tipSubmit: 'Submit form', + textSubmited: 'Form submitted successfully' } }()), DE.Views.FormsTab || {})); }); \ No newline at end of file