[SSE] Fix print titles

This commit is contained in:
Julia Radzhabova 2020-03-18 10:08:47 +03:00
parent 0ef9620d9b
commit e5c35c772e
3 changed files with 16 additions and 15 deletions

View file

@ -428,14 +428,14 @@ define([
if (_.isEmpty(value)) { if (_.isEmpty(value)) {
return true; return true;
} }
var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, value, false); var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.None, value, false);
return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true;
}; };
panel.txtRangeLeft.validation = function(value) { panel.txtRangeLeft.validation = function(value) {
if (_.isEmpty(value)) { if (_.isEmpty(value)) {
return true; return true;
} }
var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, value, false); var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.None, value, false);
return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true;
}; };
var data = ((selectdata) ? [{caption: this.textSelectRange, value: 'select'}] : []).concat([ var data = ((selectdata) ? [{caption: this.textSelectRange, value: 'select'}] : []).concat([
@ -491,7 +491,7 @@ define([
win.setSettings({ win.setSettings({
api : me.api, api : me.api,
range : (!_.isEmpty(txtRange.getValue()) && (txtRange.checkValidate()==true)) ? txtRange.getValue() : ((type=='top') ? panel.dataRangeTop : panel.dataRangeLeft), range : (!_.isEmpty(txtRange.getValue()) && (txtRange.checkValidate()==true)) ? txtRange.getValue() : ((type=='top') ? panel.dataRangeTop : panel.dataRangeLeft),
type : Asc.c_oAscSelectionDialogType.Chart type : Asc.c_oAscSelectionDialogType.None
}); });
} }
} else { } else {

View file

@ -3471,7 +3471,6 @@ define([
} }
}); });
win.show(); win.show();
win.setSettings(me.api.asc_getPageOptions(me.api.asc_getActiveWorksheetIndex()));
Common.component.Analytics.trackEvent('ToolBar', 'Print Titles'); Common.component.Analytics.trackEvent('ToolBar', 'Print Titles');
} }

View file

@ -129,7 +129,7 @@ define([
if (_.isEmpty(value)) { if (_.isEmpty(value)) {
return true; return true;
} }
var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, value, false); var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.None, value, false);
return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true;
} }
}); });
@ -163,7 +163,7 @@ define([
if (_.isEmpty(value)) { if (_.isEmpty(value)) {
return true; return true;
} }
var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, value, false); var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.None, value, false);
return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true;
} }
}); });
@ -191,6 +191,8 @@ define([
var $window = this.getChild(); var $window = this.getChild();
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
$window.find('input').on('keypress', _.bind(this.onKeyPress, this)); $window.find('input').on('keypress', _.bind(this.onKeyPress, this));
this.setSettings();
}, },
_handleInput: function(state) { _handleInput: function(state) {
@ -211,14 +213,14 @@ define([
}, },
setSettings: function (props) { setSettings: function (props) {
if (props) { if (this.api) {
// var value = props.asc_getPrintTitlesWidth(); var value = this.api.asc_getPrintTitlesRange(Asc.c_oAscPrintTitlesRangeType.current, false, this.sheet);
// this.txtRangeTop.setValue((value) ? value : ''); this.txtRangeTop.setValue((value) ? value : '');
// this.dataRangeTop = value; this.dataRangeTop = value;
//
// value = props.asc_getPrintTitlesHeight(); value = this.api.asc_getPrintTitlesRange(Asc.c_oAscPrintTitlesRangeType.current, true, this.sheet);
// this.txtRangeLeft.setValue((value) ? value : ''); this.txtRangeLeft.setValue((value) ? value : '');
// this.dataRangeLeft = value; this.dataRangeLeft = value;
} }
}, },
@ -255,7 +257,7 @@ define([
win.setSettings({ win.setSettings({
api : me.api, api : me.api,
range : (!_.isEmpty(txtRange.getValue()) && (txtRange.checkValidate()==true)) ? txtRange.getValue() : ((type=='top') ? me.dataRangeTop : me.dataRangeLeft), range : (!_.isEmpty(txtRange.getValue()) && (txtRange.checkValidate()==true)) ? txtRange.getValue() : ((type=='top') ? me.dataRangeTop : me.dataRangeLeft),
type : Asc.c_oAscSelectionDialogType.Chart type : Asc.c_oAscSelectionDialogType.None
}); });
} }
} else { } else {