[SSE] Print titles: fix presets

This commit is contained in:
Julia Radzhabova 2020-03-17 15:37:59 +03:00
parent 42ccd21630
commit c7f6ede2a4

View file

@ -143,8 +143,8 @@ define([
additionalAlign: this.menuAddAlign, additionalAlign: this.menuAddAlign,
items: [ items: [
{caption: this.textSelectRange, value: 'select'}, {caption: this.textSelectRange, value: 'select'},
{caption: this.textFrozenRows, value: Asc.c_oAscHeaderFooterField.pageCount}, {caption: this.textFrozenRows, value: 'frozen'},
{caption: this.textFirstRow, value: Asc.c_oAscHeaderFooterField.date}, {caption: this.textFirstRow, value: 'first'},
{caption: '--'}, {caption: '--'},
{caption: this.textNoRepeat, value: 'empty'} {caption: this.textNoRepeat, value: 'empty'}
] ]
@ -177,8 +177,8 @@ define([
additionalAlign: this.menuAddAlign, additionalAlign: this.menuAddAlign,
items: [ items: [
{caption: this.textSelectRange, value: 'select'}, {caption: this.textSelectRange, value: 'select'},
{caption: this.textFrozenCols, value: Asc.c_oAscHeaderFooterField.pageCount}, {caption: this.textFrozenCols, value: 'frozen'},
{caption: this.textFirstCol, value: Asc.c_oAscHeaderFooterField.date}, {caption: this.textFirstCol, value: 'first'},
{caption: '--'}, {caption: '--'},
{caption: this.textNoRepeat, value: 'empty'} {caption: this.textNoRepeat, value: 'empty'}
] ]
@ -226,13 +226,7 @@ define([
}, },
onPresetSelect: function(type, menu, item) { onPresetSelect: function(type, menu, item) {
var txtRange = (type=='top') ? this.txtRangeTop : this.txtRangeLeft, var txtRange = (type=='top') ? this.txtRangeTop : this.txtRangeLeft;
dataRangeValid = (type=='top') ? this.dataRangeTop : this.dataRangeLeft;
if (type=='top') {
} else {
}
if (item.value == 'select') { if (item.value == 'select') {
var me = this; var me = this;
if (me.api) { if (me.api) {
@ -259,16 +253,22 @@ define([
win.show(xy.left + 160, xy.top + 125); win.show(xy.left + 160, xy.top + 125);
win.setSettings({ win.setSettings({
api : me.api, api : me.api,
range : (!_.isEmpty(txtRange.getValue()) && (txtRange.checkValidate()==true)) ? txtRange.getValue() : dataRangeValid, range : (!_.isEmpty(txtRange.getValue()) && (txtRange.checkValidate()==true)) ? txtRange.getValue() : ((type=='top') ? me.dataRangeTop : me.dataRangeLeft),
type : Asc.c_oAscSelectionDialogType.Chart type : Asc.c_oAscSelectionDialogType.Chart
}); });
} }
} else if (item.value == 'empty') { } else {
txtRange.setValue(''); var value = '';
if (item.value == 'frozen')
value = this.api.asc_getFrozen(type=='top');
else if (item.value == 'first')
value = this.api.asc_getFirst(type=='top');
txtRange.setValue(value);
txtRange.checkValidate();
if (type=='top') if (type=='top')
this.dataRangeTop = ''; this.dataRangeTop = value;
else else
this.dataRangeLeft = ''; this.dataRangeLeft = value;
} }
}, },