Merge pull request #1383 from ONLYOFFICE/fix/de-forms

Fix/de forms
This commit is contained in:
Julia Radzhabova 2021-12-04 23:11:40 +03:00 committed by GitHub
commit bc0564fe2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 8 deletions

View file

@ -3818,9 +3818,13 @@ define([
var isInShape = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ShapeProperties()));
var isInChart = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ChartProperties()));
var isEquation= (value.mathProps && value.mathProps.value);
var in_toc = me.api.asc_GetTableOfContentsPr(true),
in_control = !in_toc && me.api.asc_IsContentControl(),
control_props = in_control ? me.api.asc_GetContentControlProperties() : null,
is_form = control_props && control_props.get_FormPr();
menuParagraphVAlign.setVisible(isInShape && !isInChart && !isEquation); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !!
menuParagraphDirection.setVisible(isInShape && !isInChart && !isEquation); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !!
menuParagraphVAlign.setVisible(isInShape && !isInChart && !isEquation && !(is_form && control_props.get_FormPr().get_Fixed())); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !!
menuParagraphDirection.setVisible(isInShape && !isInChart && !isEquation && !(is_form && control_props.get_FormPr().get_Fixed())); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !!
if ( isInShape || isInChart ) {
var align = value.imgProps.value.get_VerticalTextAlign();
var cls = '';
@ -3962,10 +3966,6 @@ define([
var control_lock = (value.paraProps) ? (!value.paraProps.value.can_DeleteBlockContentControl() || !value.paraProps.value.can_EditBlockContentControl() ||
!value.paraProps.value.can_DeleteInlineContentControl() || !value.paraProps.value.can_EditInlineContentControl()) : false;
var in_toc = me.api.asc_GetTableOfContentsPr(true),
in_control = !in_toc && me.api.asc_IsContentControl(),
control_props = in_control ? me.api.asc_GetContentControlProperties() : null,
is_form = control_props && control_props.get_FormPr();
menuParaRemoveControl.setVisible(in_control);
menuParaControlSettings.setVisible(in_control && me.mode.canEditContentControl && !is_form);
menuParaControlSeparator.setVisible(in_control);

View file

@ -271,13 +271,15 @@ define([
this.txtNewValue = new Common.UI.InputField({
el : $markup.findById('#form-txt-new-value'),
allowBlank : true,
validateOnChange: false,
validateOnChange: true,
validateOnBlur: false,
style : 'width: 100%;',
value : '',
dataHint : '1',
dataHintDirection: 'left',
dataHintOffset: 'small'
}).on ('changing', function (input, value) {
me.btnListAdd.setDisabled(value.length<1 || me._state.DisabledControls);
});
this.lockedControls.push(this.txtNewValue);
this.txtNewValue.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
@ -311,7 +313,6 @@ define([
dataHintOffset: 'big'
});
this.btnListAdd.on('click', _.bind(this.onAddItem, this));
this.lockedControls.push(this.btnListAdd);
this.btnListDelete = new Common.UI.Button({
parentEl: $markup.findById('#form-list-delete'),
@ -866,6 +867,7 @@ define([
this.list.scrollToRecord(rec);
} else if (!this.txtNewValue._input.is(':focus')) {
this.txtNewValue.setValue('');
this.btnListAdd.setDisabled(true);
this._state.listValue = this._state.listIndex = undefined;
}
}
@ -1201,6 +1203,7 @@ define([
var disableSliders = this._state.scaleFlag === Asc.c_oAscPictureFormScaleFlag.Always && !this._state.Aspect;
this.sldrPreviewPositionX.setDisabled(disableSliders || this._state.DisabledControls);
this.sldrPreviewPositionY.setDisabled(disableSliders || this._state.DisabledControls);
this.btnListAdd.setDisabled(this.txtNewValue.length<1 || this._state.DisabledControls);
this.btnLockForm.setDisabled(disable);
},
@ -1238,6 +1241,7 @@ define([
this.txtNewValue.setValue(record.get('name'));
this._state.listValue = record.get('name');
this._state.listIndex = undefined;
this.btnListAdd.setDisabled(this.txtNewValue.length<1 || this._state.DisabledControls);
this.disableListButtons();
},