[DE] Hide some settings for forms inside complex form

This commit is contained in:
Julia Radzhabova 2022-08-31 14:31:51 +03:00
parent 665012cebd
commit 2b9cc0f0bd
2 changed files with 23 additions and 20 deletions

View file

@ -28,7 +28,7 @@
<div id="form-txt-pholder"></div>
</td>
</tr>
<tr>
<tr class="form-not-in-complex">
<td class="padding-small">
<label class="input-label"><%= scope.textTag %></label>
<div id="form-txt-tag"></div>
@ -57,11 +57,6 @@
<div id="form-txt-format-symbols"></div>
</td>
</tr>
<tr class="form-textfield">
<td class="padding-small">
<div class="separator horizontal"></div>
</td>
</tr>
</table>
<table cols="2">
<tr class="form-list">
@ -89,22 +84,22 @@
</tr>
</table>
<table cols="1">
<tr class="form-not-image">
<tr class="form-fixed">
<td class="padding-small">
<div id="form-chb-fixed"></div>
</td>
</tr>
<tr class="form-textfield">
<tr class="form-textfield-simple">
<td class="padding-small">
<div id="form-chb-autofit"></div>
</td>
</tr>
<tr class="form-textfield">
<tr class="form-textfield-simple">
<td class="padding-small">
<div id="form-chb-multiline"></div>
</td>
</tr>
<tr class="form-textfield">
<tr class="form-textfield-simple">
<td class="padding-small">
<div class="separator horizontal"></div>
</td>
@ -195,12 +190,12 @@
<div class="separator horizontal"></div>
</td>
</tr>
<tr>
<tr class="form-not-in-complex">
<td class="padding-small">
<div id="form-chb-required"></div>
</td>
</tr>
<tr>
<tr class="form-not-in-complex">
<td class="padding-small">
<div class="separator horizontal"></div>
</td>
@ -210,7 +205,7 @@
<div id="form-btn-delete"></div>
</td>
</tr>
<tr>
<tr class="form-not-in-complex">
<td class="padding-small">
<div id="form-btn-lock"></div>
</td>

View file

@ -96,6 +96,7 @@ define([
}));
this.TextOnlySettings = el.find('.form-textfield');
this.TextOnlySimpleSettings = el.find('.form-textfield-simple'); // text field not in complex form
this.TextOnlySettingsMask = el.find('.form-textfield-mask');
this.PlaceholderSettings = el.find('.form-placeholder');
this.KeySettings = el.find('.form-keyfield');
@ -105,7 +106,8 @@ define([
this.ListOnlySettings = el.find('.form-list');
this.ImageOnlySettings = el.find('.form-image');
this.ConnectedSettings = el.find('.form-connected');
this.NotImageSettings = el.find('.form-not-image');
this.FixedSettings = el.find('.form-fixed');
this.NotInComplexSettings = el.find('.form-not-in-complex');
},
createDelayedElements: function() {
@ -1317,7 +1319,10 @@ define([
} else
this._originalTextFormProps = null;
if (props.get_ComplexFormPr()) {
var isComplex = !!props.get_ComplexFormPr(), // is complex form
isSimpleInsideComplex = !!this.api.asc_GetCurrentComplexForm() && !isComplex;
if (isComplex) {
this.labelFormName.text(this.textComplex);
}
this._noApply = false;
@ -1325,9 +1330,10 @@ define([
this.KeySettingsTd.toggleClass('padding-small', !connected);
this.ConnectedSettings.toggleClass('hidden', !connected);
this.TextOnlySettingsMask.toggleClass('hidden', !(type === Asc.c_oAscContentControlSpecificType.None && !!formTextPr) || !(this._state.FormatType===Asc.TextFormFormatType.Mask || this._state.FormatType===Asc.TextFormFormatType.RegExp));
if (this.type !== type || needUpdateTextControls || type == Asc.c_oAscContentControlSpecificType.CheckBox)
this.showHideControls(type, formTextPr, specProps);
if (this.type !== type || this.isSimpleInsideComplex !== isSimpleInsideComplex || needUpdateTextControls || type == Asc.c_oAscContentControlSpecificType.CheckBox)
this.showHideControls(type, formTextPr, specProps, isSimpleInsideComplex);
this.type = type;
this._state.isSimpleInsideComplex = isSimpleInsideComplex;
this._state.internalId = this.internalId;
}
@ -1423,7 +1429,7 @@ define([
this.btnLockForm.setDisabled(disable);
},
showHideControls: function(type, textProps, specProps) {
showHideControls: function(type, textProps, specProps, isSimpleInsideComplex) {
var textOnly = false,
checkboxOnly = false,
radioboxOnly = false,
@ -1442,14 +1448,16 @@ define([
textOnly = !!textProps;
}
this.TextOnlySettings.toggleClass('hidden', !textOnly);
this.TextOnlySimpleSettings.toggleClass('hidden', !textOnly || isSimpleInsideComplex);
this.ListOnlySettings.toggleClass('hidden', !listOnly);
this.ImageOnlySettings.toggleClass('hidden', !imageOnly);
this.RadioOnlySettings.toggleClass('hidden', !radioboxOnly);
this.KeySettings.toggleClass('hidden', radioboxOnly);
this.KeySettings.toggleClass('hidden', radioboxOnly || isSimpleInsideComplex);
var value = (checkboxOnly || radioboxOnly);
this.PlaceholderSettings.toggleClass('hidden', value);
this.CheckOnlySettings.toggleClass('hidden', !value);
this.NotImageSettings.toggleClass('hidden', imageOnly);
this.FixedSettings.toggleClass('hidden', imageOnly || isSimpleInsideComplex);
this.NotInComplexSettings.toggleClass('hidden', isSimpleInsideComplex);
},
onSelectItem: function(listView, itemView, record) {