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

View file

@ -96,6 +96,7 @@ define([
})); }));
this.TextOnlySettings = el.find('.form-textfield'); 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.TextOnlySettingsMask = el.find('.form-textfield-mask');
this.PlaceholderSettings = el.find('.form-placeholder'); this.PlaceholderSettings = el.find('.form-placeholder');
this.KeySettings = el.find('.form-keyfield'); this.KeySettings = el.find('.form-keyfield');
@ -105,7 +106,8 @@ define([
this.ListOnlySettings = el.find('.form-list'); this.ListOnlySettings = el.find('.form-list');
this.ImageOnlySettings = el.find('.form-image'); this.ImageOnlySettings = el.find('.form-image');
this.ConnectedSettings = el.find('.form-connected'); 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() { createDelayedElements: function() {
@ -1317,7 +1319,10 @@ define([
} else } else
this._originalTextFormProps = null; 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.labelFormName.text(this.textComplex);
} }
this._noApply = false; this._noApply = false;
@ -1325,9 +1330,10 @@ define([
this.KeySettingsTd.toggleClass('padding-small', !connected); this.KeySettingsTd.toggleClass('padding-small', !connected);
this.ConnectedSettings.toggleClass('hidden', !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)); 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) if (this.type !== type || this.isSimpleInsideComplex !== isSimpleInsideComplex || needUpdateTextControls || type == Asc.c_oAscContentControlSpecificType.CheckBox)
this.showHideControls(type, formTextPr, specProps); this.showHideControls(type, formTextPr, specProps, isSimpleInsideComplex);
this.type = type; this.type = type;
this._state.isSimpleInsideComplex = isSimpleInsideComplex;
this._state.internalId = this.internalId; this._state.internalId = this.internalId;
} }
@ -1423,7 +1429,7 @@ define([
this.btnLockForm.setDisabled(disable); this.btnLockForm.setDisabled(disable);
}, },
showHideControls: function(type, textProps, specProps) { showHideControls: function(type, textProps, specProps, isSimpleInsideComplex) {
var textOnly = false, var textOnly = false,
checkboxOnly = false, checkboxOnly = false,
radioboxOnly = false, radioboxOnly = false,
@ -1442,14 +1448,16 @@ define([
textOnly = !!textProps; textOnly = !!textProps;
} }
this.TextOnlySettings.toggleClass('hidden', !textOnly); this.TextOnlySettings.toggleClass('hidden', !textOnly);
this.TextOnlySimpleSettings.toggleClass('hidden', !textOnly || isSimpleInsideComplex);
this.ListOnlySettings.toggleClass('hidden', !listOnly); this.ListOnlySettings.toggleClass('hidden', !listOnly);
this.ImageOnlySettings.toggleClass('hidden', !imageOnly); this.ImageOnlySettings.toggleClass('hidden', !imageOnly);
this.RadioOnlySettings.toggleClass('hidden', !radioboxOnly); this.RadioOnlySettings.toggleClass('hidden', !radioboxOnly);
this.KeySettings.toggleClass('hidden', radioboxOnly); this.KeySettings.toggleClass('hidden', radioboxOnly || isSimpleInsideComplex);
var value = (checkboxOnly || radioboxOnly); var value = (checkboxOnly || radioboxOnly);
this.PlaceholderSettings.toggleClass('hidden', value); this.PlaceholderSettings.toggleClass('hidden', value);
this.CheckOnlySettings.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) { onSelectItem: function(listView, itemView, record) {