[DE] Change settings for check box content control

This commit is contained in:
Julia Radzhabova 2019-12-02 14:47:02 +03:00
parent 291807d986
commit ded99f23fb
4 changed files with 19 additions and 41 deletions

View file

@ -174,7 +174,7 @@ define([
hint: this.tipChange hint: this.tipChange
}); });
this.btnEdit.on('click', _.bind(this.onEditBullet, this)); this.btnEdit.on('click', _.bind(this.onEditBullet, this));
this.btnEdit.cmpEl.css({'font-size': '12px'}); this.btnEdit.cmpEl.css({'font-size': '16px', 'line-height': '16px'});
this.afterRender(); this.afterRender();
}, },

View file

@ -123,16 +123,13 @@
</div> </div>
<div id="id-adv-control-settings-checkbox" class="settings-panel"> <div id="id-adv-control-settings-checkbox" class="settings-panel">
<div class="inner-content"> <div class="inner-content">
<table cols="3" style="width: auto;"> <table cols="2" style="width: auto;">
<tr> <tr>
<td class="padding-small"> <td class="padding-small">
<label class="input-label" style="margin-right: 10px;"><%= scope.textChecked %></label> <label class="input-label" style="margin-right: 10px;"><%= scope.textChecked %></label>
</td> </td>
<td class="padding-small"> <td class="padding-small">
<div id="control-settings-input-checked" style="margin-right: 10px;"></div> <button type="button" class="btn btn-text-default" id="control-settings-btn-checked-edit" style="width:53px"></button>
</td>
<td class="padding-small">
<button type="button" class="btn btn-text-default" id="control-settings-btn-checked-edit" style="min-width:86px;"><%= scope.textChange %></button>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -140,10 +137,7 @@
<label class="input-label" style="margin-right: 10px;"><%= scope.textUnchecked %></label> <label class="input-label" style="margin-right: 10px;"><%= scope.textUnchecked %></label>
</td> </td>
<td class="padding-small"> <td class="padding-small">
<div id="control-settings-input-unchecked" style="margin-right: 10px;"></div> <button type="button" class="btn btn-text-default" id="control-settings-btn-unchecked-edit" style="width:53px"></button>
</td>
<td class="padding-small">
<button type="button" class="btn btn-text-default" id="control-settings-btn-unchecked-edit" style="min-width:86px;"><%= scope.textChange %></button>
</td> </td>
</tr> </tr>
</table> </table>

View file

@ -238,36 +238,18 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
}); });
// Check Box // Check Box
this.txtChecked = new Common.UI.InputField({
el : $('#control-settings-input-checked'),
allowBlank : true,
validateOnChange: false,
validateOnBlur: false,
style : 'width: 30px;',
value : ''
});
this.txtChecked._input.attr('disabled', true);
this.txtChecked._input.css({'text-align': 'center', 'font-size': '16px'});
this.txtUnchecked = new Common.UI.InputField({
el : $('#control-settings-input-unchecked'),
allowBlank : true,
validateOnChange: false,
validateOnBlur: false,
style : 'width: 30px;',
value : ''
});
this.txtUnchecked._input.attr('disabled', true);
this.txtUnchecked._input.css({'text-align': 'center', 'font-size': '16px'});
this.btnEditChecked = new Common.UI.Button({ this.btnEditChecked = new Common.UI.Button({
el: $('#control-settings-btn-checked-edit') el: $('#control-settings-btn-checked-edit'),
hint: this.tipChange
}); });
this.btnEditChecked.cmpEl.css({'font-size': '16px', 'line-height': '16px'});
this.btnEditChecked.on('click', _.bind(this.onEditCheckbox, this, true)); this.btnEditChecked.on('click', _.bind(this.onEditCheckbox, this, true));
this.btnEditUnchecked = new Common.UI.Button({ this.btnEditUnchecked = new Common.UI.Button({
el: $('#control-settings-btn-unchecked-edit') el: $('#control-settings-btn-unchecked-edit'),
hint: this.tipChange
}); });
this.btnEditUnchecked.cmpEl.css({'font-size': '16px', 'line-height': '16px'});
this.btnEditUnchecked.on('click', _.bind(this.onEditCheckbox, this, false)); this.btnEditUnchecked.on('click', _.bind(this.onEditCheckbox, this, false));
this.afterRender(); this.afterRender();
@ -388,14 +370,14 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
if (specProps) { if (specProps) {
var code = specProps.get_CheckedSymbol(), var code = specProps.get_CheckedSymbol(),
font = specProps.get_CheckedFont(); font = specProps.get_CheckedFont();
font && this.txtChecked.cmpEl.css('font-family', font); font && this.btnEditChecked.cmpEl.css('font-family', font);
code && this.txtChecked.setValue(String.fromCharCode(code)); code && this.btnEditChecked.setCaption(String.fromCharCode(code));
this.checkedBox = {code: code, font: font}; this.checkedBox = {code: code, font: font};
code = specProps.get_UncheckedSymbol(); code = specProps.get_UncheckedSymbol();
font = specProps.get_UncheckedFont(); font = specProps.get_UncheckedFont();
font && this.txtUnchecked.cmpEl.css('font-family', font); font && this.btnEditUnchecked.cmpEl.css('font-family', font);
code && this.txtUnchecked.setValue(String.fromCharCode(code)); code && this.btnEditUnchecked.setCaption(String.fromCharCode(code));
this.uncheckedBox = {code: code, font: font}; this.uncheckedBox = {code: code, font: font};
} }
} }
@ -599,14 +581,14 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
if (this.api) { if (this.api) {
var me = this, var me = this,
props = (checked) ? me.checkedBox : me.uncheckedBox, props = (checked) ? me.checkedBox : me.uncheckedBox,
cmp = (checked) ? me.txtChecked : me.txtUnchecked, cmp = (checked) ? me.btnEditChecked : me.btnEditUnchecked,
handler = function(dlg, result, settings) { handler = function(dlg, result, settings) {
if (result == 'ok') { if (result == 'ok') {
props.changed = true; props.changed = true;
props.code = settings.code; props.code = settings.code;
props.font = settings.font; props.font = settings.font;
props.font && cmp.cmpEl.css('font-family', props.font); props.font && cmp.cmpEl.css('font-family', props.font);
settings.symbol && cmp.setValue(settings.symbol); settings.symbol && cmp.setCaption(settings.symbol);
} }
}, },
win = new Common.Views.SymbolTableDialog({ win = new Common.Views.SymbolTableDialog({
@ -657,7 +639,8 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
textFormat: 'Display the date like this', textFormat: 'Display the date like this',
textCheckbox: 'Check box', textCheckbox: 'Check box',
textChecked: 'Checked symbol', textChecked: 'Checked symbol',
textUnchecked: 'Unchecked symbol' textUnchecked: 'Unchecked symbol',
tipChange: 'Change symbol'
}, DE.Views.ControlSettingsDialog || {})) }, DE.Views.ControlSettingsDialog || {}))
}); });

View file

@ -1160,6 +1160,7 @@
"DE.Views.ControlSettingsDialog.textCheckbox": "Check box", "DE.Views.ControlSettingsDialog.textCheckbox": "Check box",
"DE.Views.ControlSettingsDialog.textChecked": "Checked symbol", "DE.Views.ControlSettingsDialog.textChecked": "Checked symbol",
"DE.Views.ControlSettingsDialog.textUnchecked": "Unchecked symbol", "DE.Views.ControlSettingsDialog.textUnchecked": "Unchecked symbol",
"DE.Views.ControlSettingsDialog.tipChange": "Change symbol",
"DE.Views.CustomColumnsDialog.textColumns": "Number of columns", "DE.Views.CustomColumnsDialog.textColumns": "Number of columns",
"DE.Views.CustomColumnsDialog.textSeparator": "Column divider", "DE.Views.CustomColumnsDialog.textSeparator": "Column divider",
"DE.Views.CustomColumnsDialog.textSpacing": "Spacing between columns", "DE.Views.CustomColumnsDialog.textSpacing": "Spacing between columns",