[DE] Submit form

This commit is contained in:
Julia Radzhabova 2021-02-09 13:31:05 +03:00
parent 616f77d34d
commit bf07d08dca
3 changed files with 22 additions and 5 deletions

View file

@ -70,8 +70,9 @@ 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_onStartAction', _.bind(this.onLongActionBegin, this));
this.api.asc_registerCallback('asc_onEndAction', _.bind(this.onLongActionEnd, this));
this.api.asc_registerCallback('asc_onError', _.bind(this.onError, this));
// this.api.asc_registerCallback('asc_onShowContentControlsActions',_.bind(this.onShowContentControlsActions, this));
// this.api.asc_registerCallback('asc_onHideContentControlsActions',_.bind(this.onHideContentControlsActions, this));
@ -232,7 +233,7 @@ define([
},
onSubmitClick: function() {
// this.api.asc_SubmitForm();
this.api.asc_SendForm();
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
},
@ -260,6 +261,8 @@ define([
onLongActionBegin: function(type, id) {
if (id==Asc.c_oAscAsyncAction['Submit'] && this.view.btnSubmit) {
this._submitFail = false;
this.submitedTooltip && this.submitedTooltip.hide();
this.view.btnSubmit.setDisabled(true);
}
},
@ -279,7 +282,14 @@ define([
this.submitedTooltip.hide();
}, this);
}
this.submitedTooltip.show();
!this._submitFail && this.submitedTooltip.show();
}
},
onError: function(id, level, errData) {
if (id==Asc.c_oAscError.ID.Submit) {
this._submitFail = true;
this.submitedTooltip && this.submitedTooltip.hide();
}
},

View file

@ -1662,6 +1662,10 @@ define([
config.msg = this.errorSetPassword;
break;
case Asc.c_oAscError.ID.Submit:
config.msg = this.errorSubmit;
break;
default:
config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id);
break;
@ -2833,7 +2837,8 @@ define([
textRenameLabel: 'Enter a name to be used for collaboration',
textRenameError: 'User name must not be empty.',
textLongName: 'Enter a name that is less than 128 characters.',
textGuest: 'Guest'
textGuest: 'Guest',
errorSubmit: 'Submit failed.'
}
})(), DE.Controllers.Main || {}))
});

View file

@ -818,6 +818,7 @@
"DE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact %1 sales team for personal upgrade terms.",
"DE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
"DE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"DE.Controllers.Main.errorSubmit": "Submit failed.",
"DE.Controllers.Navigation.txtBeginning": "Beginning of document",
"DE.Controllers.Navigation.txtGotoBeginning": "Go to the beginning of the document",
"DE.Controllers.Statusbar.textHasChanges": "New changes have been tracked",
@ -1749,6 +1750,7 @@
"DE.Views.FormsTab.tipPrevForm": "Go to the previous field",
"DE.Views.FormsTab.tipNextForm": "Go to the next field",
"DE.Views.FormsTab.tipSubmit": "Submit form",
"DE.Views.FormsTab.textSubmited": "Form submitted successfully",
"DE.Views.HeaderFooterSettings.textBottomCenter": "Bottom center",
"DE.Views.HeaderFooterSettings.textBottomLeft": "Bottom left",
"DE.Views.HeaderFooterSettings.textBottomPage": "Bottom of Page",