[SSE] Refactoring cond. formatting

This commit is contained in:
Julia Radzhabova 2021-03-03 22:50:19 +03:00
parent 2d188d6688
commit e27547b240
2 changed files with 8 additions and 8 deletions

View file

@ -1193,12 +1193,12 @@ define([
menuStyle : 'min-width: 100%;', menuStyle : 'min-width: 100%;',
editable : false, editable : false,
cls : 'input-group-nr', cls : 'input-group-nr',
data : [{value: 0, displayValue: '>=', prevOp: '<'}, {value: 1, displayValue: '>', prevOp: '<='}], data : [{value: true, displayValue: '>=', prevOp: '<'}, {value: false, displayValue: '>', prevOp: '<='}],
type : i type : i
}).on('selected', function(combo, record) { }).on('selected', function(combo, record) {
me.fillIconsLabels(); me.fillIconsLabels();
}); });
combo.setValue(0); combo.setValue(1);
this.iconsControls[i].cmbOperator = combo; this.iconsControls[i].cmbOperator = combo;
var range = new Common.UI.InputFieldBtn({ var range = new Common.UI.InputFieldBtn({
@ -1554,6 +1554,7 @@ define([
value = new AscCommonExcel.CConditionalFormatValueObject(); value = new AscCommonExcel.CConditionalFormatValueObject();
value.asc_setType(controls.cmbType.getValue()); value.asc_setType(controls.cmbType.getValue());
value.asc_setVal(controls.value.getValue()); value.asc_setVal(controls.value.getValue());
value.asc_setGte(controls.cmbOperator.getValue());
values.push(value); values.push(value);
if (icons) { if (icons) {
this.iconsProps.isReverse ? icons.unshift(controls.pickerIcons.getSelectedRec().get('value')+1) : icons.push(controls.pickerIcons.getSelectedRec().get('value')+1); this.iconsProps.isReverse ? icons.unshift(controls.pickerIcons.getSelectedRec().get('value')+1) : icons.push(controls.pickerIcons.getSelectedRec().get('value')+1);
@ -1905,11 +1906,10 @@ define([
var arr = this.iconsControls; var arr = this.iconsControls;
for (var i=0; i<values.length; i++) { for (var i=0; i<values.length; i++) {
var icontype = values[i].asc_getType(), var controls = arr[i];
val = values[i].asc_getVal(), controls.cmbType.setValue(values[i].asc_getType());
controls = arr[i]; controls.value.setValue(values[i].asc_getVal() || '');
controls.cmbType.setValue(icontype); controls.cmbOperator.setValue(values[i].asc_getGte());
controls.value.setValue(val || '');
} }
if (icons && icons.length>0) { if (icons && icons.length>0) {
this.cmbIconsPresets.setValue(this.textCustom); this.cmbIconsPresets.setValue(this.textCustom);

View file

@ -691,7 +691,7 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesManagerDlg.templa
}, },
onKeyDown: function (lisvView, record, e) { onKeyDown: function (lisvView, record, e) {
if (e.keyCode==Common.UI.Keys.DELETE && !this.btnDelete.isDisabled()) if (e.keyCode==Common.UI.Keys.DELETE && !this.btnDelete.isDisabled() && !/form-control/.test(e.target.className))
this.onDeleteRule(); this.onDeleteRule();
}, },