[SSE] Print titles: select range only in the active sheet

This commit is contained in:
Julia Radzhabova 2020-03-19 12:15:45 +03:00
parent 7fe3294a8f
commit e84e07ef0b
3 changed files with 11 additions and 4 deletions

View file

@ -169,6 +169,10 @@ define([
panel.txtRangeLeft.checkValidate();
panel.dataRangeLeft = value;
value = (this.api.asc_getActiveWorksheetIndex()==sheet);
(panel.btnPresetsTop.menu.items[0].value == 'select') && panel.btnPresetsTop.menu.items[0].setVisible(value);
(panel.btnPresetsLeft.menu.items[0].value == 'select') && panel.btnPresetsLeft.menu.items[0].setVisible(value);
panel.btnPresetsTop.menu.items[panel.btnPresetsTop.menu.items[0].value == 'frozen' ? 0 : 1].setDisabled(!this.api.asc_getPrintTitlesRange(Asc.c_oAscPrintTitlesRangeType.frozen, false, sheet));
panel.btnPresetsLeft.menu.items[panel.btnPresetsLeft.menu.items[0].value == 'frozen' ? 0 : 1].setDisabled(!this.api.asc_getPrintTitlesRange(Asc.c_oAscPrintTitlesRangeType.frozen, true, sheet));
},

View file

@ -150,7 +150,8 @@ define([
onWorkbookLocked: function(locked) {
this.statusbar.tabbar[locked?'addClass':'removeClass']('coauth-locked');
this.statusbar.btnAddWorksheet.setDisabled(locked || this.api.isCellEdited || this.statusbar.rangeSelectionMode==Asc.c_oAscSelectionDialogType.Chart ||
this.statusbar.rangeSelectionMode==Asc.c_oAscSelectionDialogType.FormatTable);
this.statusbar.rangeSelectionMode==Asc.c_oAscSelectionDialogType.FormatTable||
this.statusbar.rangeSelectionMode==Asc.c_oAscSelectionDialogType.PrintTitles);
var item, i = this.statusbar.tabbar.getCount();
while (i-- > 0) {
item = this.statusbar.tabbar.getAt(i);
@ -170,7 +171,7 @@ define([
tab = this.statusbar.tabbar.getAt(i);
if (index == tab.sheetindex) {
tab[locked?'addClass':'removeClass']('coauth-locked');
tab.isLockTheDrag = locked || (this.statusbar.rangeSelectionMode==Asc.c_oAscSelectionDialogType.FormatTable);
tab.isLockTheDrag = locked || (this.statusbar.rangeSelectionMode==Asc.c_oAscSelectionDialogType.FormatTable) || (this.statusbar.rangeSelectionMode==Asc.c_oAscSelectionDialogType.PrintTitles);
tab.$el.children(':first-child').attr('draggable', tab.isLockTheDrag?'false':'true');
break;
}
@ -241,7 +242,7 @@ define([
while (i-- > 0) {
item = this.statusbar.tabbar.getAt(i);
if (item.sheetindex !== currentIdx) {
item.disable(mode==Asc.c_oAscSelectionDialogType.FormatTable);
item.disable(mode==Asc.c_oAscSelectionDialogType.FormatTable || mode==Asc.c_oAscSelectionDialogType.PrintTitles);
}
item.isLockTheDrag = (item.hasClass('coauth-locked') || (mode!=Asc.c_oAscSelectionDialogType.None));
}

View file

@ -179,7 +179,8 @@ define([
'tab:contextmenu' : _.bind(this.onTabMenu, this),
'tab:dblclick' : _.bind(function () {
if (me.editMode && (me.rangeSelectionMode !== Asc.c_oAscSelectionDialogType.Chart) &&
(me.rangeSelectionMode !== Asc.c_oAscSelectionDialogType.FormatTable)) {
(me.rangeSelectionMode !== Asc.c_oAscSelectionDialogType.FormatTable)&&
(me.rangeSelectionMode !== Asc.c_oAscSelectionDialogType.PrintTitles)) {
me.fireEvent('sheet:changename');
}
}, this),
@ -509,6 +510,7 @@ define([
var me = this;
if (this.mode.isEdit && !this.isEditFormula && (this.rangeSelectionMode !== Asc.c_oAscSelectionDialogType.Chart) &&
(this.rangeSelectionMode !== Asc.c_oAscSelectionDialogType.FormatTable) &&
(this.rangeSelectionMode !== Asc.c_oAscSelectionDialogType.PrintTitles) &&
!this.mode.isDisconnected ) {
if (tab && tab.sheetindex >= 0) {
var rect = tab.$el.get(0).getBoundingClientRect(),