Submit form

This commit is contained in:
Julia Radzhabova 2021-02-06 14:58:40 +03:00
parent e37b10ea23
commit 5308f61223
2 changed files with 27 additions and 1 deletions

View file

@ -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) {

View file

@ -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 || {}));
});