[DE embed] Use embedded mode for filling forms

This commit is contained in:
Julia Radzhabova 2021-04-26 18:36:40 +03:00
parent d2921f946d
commit 0941465355
5 changed files with 40 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

View file

@ -475,6 +475,26 @@
}
}
.png-icon {
display: inline-block;
vertical-align: middle;
cursor: pointer;
background-color: transparent;
border: 1px solid transparent;
border-radius: 2px;
width: 24px;
height: 22px;
&.prev {
background: data-uri('../../../../common/embed/resources/img/previous-field.png') no-repeat;
background-size: cover;
}
&.next {
background: data-uri('../../../../common/embed/resources/img/next-field.png') no-repeat;
background-size: cover;
}
}
.mi-icon {
width: @icon-width;
height: @icon-height;
@ -565,6 +585,7 @@
}
#box-tools {
display: inline-block;
button {
width: 24px;
height: 22px;

View file

@ -187,6 +187,8 @@
<div id="box-tools" class="dropdown">
<button class="control-btn svg-icon tools"></button>
</div>
<button id="id-btn-prev-field" class="png-icon prev"></button>
<button id="id-btn-next-field" class="png-icon next"></button>
</div>
<div class="group center">
<span><a id="header-logo" class="brand-logo" href="http://www.onlyoffice.com/" target="_blank"></a></span>

View file

@ -364,7 +364,23 @@ DE.ApplicationController = new(function(){
logo.attr('href', config.customization.logo.url);
}
}
api.asc_setViewMode(true);
var licType = params.asc_getLicenseType();
// var canFillForms = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit) && (permissions.fillForms===true) && (config.mode !== 'view');
var canFillForms = true;
if (!canFillForms) {
$('#id-btn-prev-field').hide();
$('#id-btn-next-field').hide();
} else {
$('#id-btn-prev-field').on('click', function(){
api.asc_MoveToFillingForm(false);
});
$('#id-btn-next-field').on('click', function(){
api.asc_MoveToFillingForm(true);
});
}
api.asc_setViewMode(!canFillForms);
canFillForms && api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms);
api.asc_LoadDocument();
api.Resize();
}