[DE] Fix text field settings

This commit is contained in:
Julia Radzhabova 2020-06-25 14:13:08 +03:00
parent 9c30933ef0
commit 5a059744d2
2 changed files with 16 additions and 10 deletions

View file

@ -189,8 +189,13 @@
<table cols="2" style="width: auto;">
<tr>
<td class="padding-small" colspan="2">
<label class="input-label" style="margin-right: 10px;"><%= scope.textWidth %></label>
<div id="control-settings-spin-width" style=""></div>
<div id="control-settings-chb-max-chars" style="display: inline-block;margin-right: 10px;"></div>
<div id="control-settings-spin-max-chars" style="display: inline-block;"></div>
</td>
</tr>
<tr>
<td class="padding-small" colspan="2">
<div id="control-settings-chb-comb"></div>
</td>
</tr>
<tr>
@ -203,13 +208,8 @@
</tr>
<tr>
<td class="padding-small" colspan="2">
<div id="control-settings-chb-max-chars" style="display: inline-block;margin-right: 10px;"></div>
<div id="control-settings-spin-max-chars" style="display: inline-block;"></div>
</td>
</tr>
<tr>
<td class="padding-small" colspan="2">
<div id="control-settings-chb-comb"></div>
<label class="input-label" style="margin-right: 10px;"><%= scope.textWidth %></label>
<div id="control-settings-spin-width" style=""></div>
</td>
</tr>
</table>

View file

@ -335,9 +335,12 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
labelText: this.textComb
});
this.chComb.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (field.getValue()=='checked') {
var checked = (field.getValue()=='checked');
if (checked) {
this.chMaxChars.setValue(true);
}
this.btnEditPlaceholder.setDisabled(!checked);
this.spnWidth.setDisabled(!checked);
}, this));
this.afterRender();
@ -510,6 +513,9 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
val = formTextPr.get_Comb();
this.chComb.setValue(!!val, true);
this.btnEditPlaceholder.setDisabled(!val);
this.spnWidth.setDisabled(!val);
val = formTextPr.get_MaxCharacters();
this.chMaxChars.setValue(val && val>=0, true);
this.spnMaxChars.setDisabled(!val || val<0);