[DE embedded] Fix submit action
This commit is contained in:
parent
01ce207277
commit
34fafd5c1a
|
@ -67,6 +67,7 @@
|
|||
@btnColored: #446995;
|
||||
@btnActiveColored: #293F59;
|
||||
@btnHoverColored: #375478;
|
||||
@notificationColor: #fcfed7;
|
||||
|
||||
@iconSpriteCommonPath: "../../../../common/embed/resources/img/glyphicons.png";
|
||||
@icon-socnet-size: 40px;
|
||||
|
@ -300,6 +301,10 @@
|
|||
border: 1px solid @btnActiveColor;
|
||||
background-color: @btnActiveColor;
|
||||
}
|
||||
|
||||
&[disabled] {
|
||||
opacity: 0.4;
|
||||
}
|
||||
}
|
||||
|
||||
// Overlay control
|
||||
|
@ -694,3 +699,17 @@
|
|||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
.submit-tooltip {
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
top: 58px;
|
||||
right: 15px;
|
||||
|
||||
padding: 7px 15px;
|
||||
border-radius: 5px;
|
||||
background-color: @notificationColor;
|
||||
-webkit-box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.5);
|
||||
box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.5);
|
||||
font-size: 11px;
|
||||
}
|
|
@ -41,7 +41,9 @@ DE.ApplicationController = new(function(){
|
|||
created = false,
|
||||
ttOffset = [0, -10],
|
||||
labelDocName,
|
||||
appOptions = {};
|
||||
appOptions = {},
|
||||
btnSubmit,
|
||||
_submitFail, $submitedTooltip;
|
||||
|
||||
// Initialize analytics
|
||||
// -------------------------
|
||||
|
@ -144,6 +146,11 @@ DE.ApplicationController = new(function(){
|
|||
case Asc.c_oAscAsyncAction['Print']:
|
||||
text = me.downloadTextText;
|
||||
break;
|
||||
case Asc.c_oAscAsyncAction['Submit']:
|
||||
_submitFail = false;
|
||||
$submitedTooltip && $submitedTooltip.hide();
|
||||
btnSubmit.attr({disabled: true});
|
||||
break;
|
||||
default:
|
||||
text = me.waitText;
|
||||
break;
|
||||
|
@ -155,7 +162,16 @@ DE.ApplicationController = new(function(){
|
|||
}
|
||||
}
|
||||
|
||||
function onLongActionEnd(){
|
||||
function onLongActionEnd(type, id){
|
||||
if (id==Asc.c_oAscAsyncAction['Submit']) {
|
||||
btnSubmit.removeAttr('disabled');
|
||||
if (!$submitedTooltip) {
|
||||
$submitedTooltip = $('<div class="submit-tooltip" style="display:none;">' + me.textSubmited + '</div>');
|
||||
$(document.body).append($submitedTooltip);
|
||||
$submitedTooltip.on('click', function() {$submitedTooltip.hide();});
|
||||
}
|
||||
!_submitFail && $submitedTooltip.show();
|
||||
}
|
||||
hideMask();
|
||||
}
|
||||
|
||||
|
@ -419,11 +435,13 @@ DE.ApplicationController = new(function(){
|
|||
|
||||
api.asc_setViewMode(!appOptions.canFillForms);
|
||||
|
||||
btnSubmit = $('#id-btn-submit');
|
||||
|
||||
if (!appOptions.canFillForms) {
|
||||
$('#id-btn-prev-field').hide();
|
||||
$('#id-btn-next-field').hide();
|
||||
$('#id-btn-clear-fields').hide();
|
||||
$('#id-btn-submit').hide();
|
||||
btnSubmit.hide();
|
||||
} else {
|
||||
$('#id-pages').hide();
|
||||
$('#id-btn-next-field .caption').text(me.textNext);
|
||||
|
@ -440,12 +458,12 @@ DE.ApplicationController = new(function(){
|
|||
});
|
||||
|
||||
if (appOptions.canSubmitForms) {
|
||||
$('#id-btn-submit .caption').text(me.textSubmit);
|
||||
$('#id-btn-submit').on('click', function(){
|
||||
btnSubmit.find('.caption').text(me.textSubmit);
|
||||
btnSubmit.on('click', function(){
|
||||
api.asc_SendForm();
|
||||
});
|
||||
} else
|
||||
$('#id-btn-submit').hide();
|
||||
btnSubmit.hide();
|
||||
|
||||
api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms);
|
||||
api.asc_SetFastCollaborative(true);
|
||||
|
@ -534,6 +552,16 @@ DE.ApplicationController = new(function(){
|
|||
message = me.errorAccessDeny;
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.Submit:
|
||||
message = me.errorSubmit;
|
||||
_submitFail = true;
|
||||
$submitedTooltip && $submitedTooltip.hide();
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.EditingError:
|
||||
message = me.errorEditingDownloadas;
|
||||
break;
|
||||
|
||||
default:
|
||||
message = me.errorDefaultMessage.replace('%1', id);
|
||||
break;
|
||||
|
@ -704,6 +732,9 @@ DE.ApplicationController = new(function(){
|
|||
errorUpdateVersionOnDisconnect: 'Internet connection has been restored, and the file version has been changed.<br>Before you can continue working, you need to download the file or copy its content to make sure nothing is lost, and then reload this page.',
|
||||
textNext: 'Next Field',
|
||||
textClear: 'Clear All Fields',
|
||||
textSubmit: 'Submit'
|
||||
textSubmit: 'Submit',
|
||||
textSubmited: '<b>Form submitted successfully</b><br>Click to close the tip.',
|
||||
errorSubmit: 'Submit failed.',
|
||||
errorEditingDownloadas: 'An error occurred during the work with the document.<br>Use the \'Download as...\' option to save the file backup copy to your computer hard drive.'
|
||||
}
|
||||
})();
|
|
@ -26,6 +26,9 @@
|
|||
"DE.ApplicationController.textNext": "Next Field",
|
||||
"DE.ApplicationController.textClear": "Clear All Fields",
|
||||
"DE.ApplicationController.textSubmit": "Submit",
|
||||
"DE.ApplicationController.textSubmited": "<b>Form submitted successfully</b><br>Click to close the tip",
|
||||
"DE.ApplicationController.errorSubmit": "Submit failed.",
|
||||
"DE.ApplicationController.errorEditingDownloadas": "An error occurred during the work with the document.<br>Use the 'Download as...' option to save the file backup copy to your computer hard drive.",
|
||||
"DE.ApplicationView.txtDownload": "Download",
|
||||
"DE.ApplicationView.txtEmbed": "Embed",
|
||||
"DE.ApplicationView.txtFullScreen": "Full Screen",
|
||||
|
|
Loading…
Reference in a new issue