[SSE] Fix selecting range

This commit is contained in:
Julia Radzhabova 2020-04-25 14:06:43 +03:00
parent 3c9046eaec
commit 68ae80a3f5
3 changed files with 30 additions and 29 deletions

View file

@ -95,7 +95,7 @@ define([
menu: true, menu: true,
split: false, split: false,
disabled: true, disabled: true,
lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth] lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.noSubitems]
}); });
Common.Utils.injectComponent($host.find('#slot-btn-financial'), this.btnFinancial); Common.Utils.injectComponent($host.find('#slot-btn-financial'), this.btnFinancial);
this.lockedControls.push(this.btnFinancial); this.lockedControls.push(this.btnFinancial);
@ -109,7 +109,7 @@ define([
menu: true, menu: true,
split: false, split: false,
disabled: true, disabled: true,
lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth] lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.noSubitems]
}); });
Common.Utils.injectComponent($host.find('#slot-btn-logical'), this.btnLogical); Common.Utils.injectComponent($host.find('#slot-btn-logical'), this.btnLogical);
this.lockedControls.push(this.btnLogical); this.lockedControls.push(this.btnLogical);
@ -123,7 +123,7 @@ define([
menu: true, menu: true,
split: false, split: false,
disabled: true, disabled: true,
lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth] lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.noSubitems]
}); });
Common.Utils.injectComponent($host.find('#slot-btn-text'), this.btnTextData); Common.Utils.injectComponent($host.find('#slot-btn-text'), this.btnTextData);
this.lockedControls.push(this.btnTextData); this.lockedControls.push(this.btnTextData);
@ -137,7 +137,7 @@ define([
menu: true, menu: true,
split: false, split: false,
disabled: true, disabled: true,
lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth] lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.noSubitems]
}); });
Common.Utils.injectComponent($host.find('#slot-btn-datetime'), this.btnDateTime); Common.Utils.injectComponent($host.find('#slot-btn-datetime'), this.btnDateTime);
this.lockedControls.push(this.btnDateTime); this.lockedControls.push(this.btnDateTime);
@ -151,7 +151,7 @@ define([
menu: true, menu: true,
split: false, split: false,
disabled: true, disabled: true,
lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth] lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.noSubitems]
}); });
Common.Utils.injectComponent($host.find('#slot-btn-lookup'), this.btnReference); Common.Utils.injectComponent($host.find('#slot-btn-lookup'), this.btnReference);
this.lockedControls.push(this.btnReference); this.lockedControls.push(this.btnReference);
@ -165,7 +165,7 @@ define([
menu: true, menu: true,
split: false, split: false,
disabled: true, disabled: true,
lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth] lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.noSubitems]
}); });
Common.Utils.injectComponent($host.find('#slot-btn-math'), this.btnMath); Common.Utils.injectComponent($host.find('#slot-btn-math'), this.btnMath);
this.lockedControls.push(this.btnMath); this.lockedControls.push(this.btnMath);
@ -179,7 +179,7 @@ define([
menu: true, menu: true,
split: false, split: false,
disabled: true, disabled: true,
lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth] lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.noSubitems]
}); });
Common.Utils.injectComponent($host.find('#slot-btn-recent'), this.btnRecent); Common.Utils.injectComponent($host.find('#slot-btn-recent'), this.btnRecent);
this.lockedControls.push(this.btnRecent); this.lockedControls.push(this.btnRecent);
@ -231,7 +231,7 @@ define([
menu: true, menu: true,
split: false, split: false,
disabled: true, disabled: true,
lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth] lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.noSubitems]
}); });
Common.Utils.injectComponent($host.find('#slot-btn-more'), this.btnMore); Common.Utils.injectComponent($host.find('#slot-btn-more'), this.btnMore);
this.lockedControls.push(this.btnMore); this.lockedControls.push(this.btnMore);
@ -296,7 +296,7 @@ define([
var _menu = new Common.UI.Menu({ var _menu = new Common.UI.Menu({
items: [ items: [
{caption: me.textCalculateWorkbook, value: Asc.c_oAscCalculateType.All}, {caption: me.textCalculateWorkbook, value: Asc.c_oAscCalculateType.All},
{caption: me.textCalculateCurrentSheet, value: Asc.c_oAscCalculateType.ActiveSheet}, {caption: me.textCalculateCurrentSheet, value: Asc.c_oAscCalculateType.ActiveSheet}
//{caption: '--'}, //{caption: '--'},
//{caption: me.textAutomatic, value: '', toggleGroup: 'menuCalcMode', checkable: true, checked: true}, //{caption: me.textAutomatic, value: '', toggleGroup: 'menuCalcMode', checkable: true, checked: true},
//{caption: me.textManual, value: '', toggleGroup: 'menuCalcMode', checkable: true, checked: false} //{caption: me.textManual, value: '', toggleGroup: 'menuCalcMode', checkable: true, checked: false}
@ -428,7 +428,7 @@ define([
menu._outerMenu = btn.menu; menu._outerMenu = btn.menu;
} }
} }
btn.setDisabled(arr.length<1); Common.Utils.lockControls(SSE.enumLock.noSubitems, arr.length<1, {array: [btn]});
}, },
setMenuItemMenu: function(name) { setMenuItemMenu: function(name) {
@ -544,7 +544,7 @@ define([
menu.cmpEl.attr({tabindex: "-1"}); menu.cmpEl.attr({tabindex: "-1"});
}); });
} }
btn.setDisabled(morearr.length<1); Common.Utils.lockControls(SSE.enumLock.noSubitems, morearr.length<1, {array: [btn]});
} }
}, },

View file

@ -156,25 +156,25 @@ define([
this.chRowHeader = new Common.UI.CheckBox({ this.chRowHeader = new Common.UI.CheckBox({
labelText: this.textRowHeader, labelText: this.textRowHeader,
lock : [_set.lostConnect, _set.coAuth, _set.noPivot] lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit]
}); });
this.lockedControls.push(this.chRowHeader); this.lockedControls.push(this.chRowHeader);
this.chColHeader = new Common.UI.CheckBox({ this.chColHeader = new Common.UI.CheckBox({
labelText: this.textColHeader, labelText: this.textColHeader,
lock : [_set.lostConnect, _set.coAuth, _set.noPivot] lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit]
}); });
this.lockedControls.push(this.chColHeader); this.lockedControls.push(this.chColHeader);
this.chRowBanded = new Common.UI.CheckBox({ this.chRowBanded = new Common.UI.CheckBox({
labelText: this.textRowBanded, labelText: this.textRowBanded,
lock : [_set.lostConnect, _set.coAuth, _set.noPivot] lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit]
}); });
this.lockedControls.push(this.chRowBanded); this.lockedControls.push(this.chRowBanded);
this.chColBanded = new Common.UI.CheckBox({ this.chColBanded = new Common.UI.CheckBox({
labelText: this.textColBanded, labelText: this.textColBanded,
lock : [_set.lostConnect, _set.coAuth, _set.noPivot] lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit]
}); });
this.lockedControls.push(this.chColBanded); this.lockedControls.push(this.chColBanded);
@ -183,7 +183,7 @@ define([
iconCls: 'toolbar__icon btn-add-pivot', iconCls: 'toolbar__icon btn-add-pivot',
caption: this.txtCreate, caption: this.txtCreate,
disabled : false, disabled : false,
lock : [_set.lostConnect, _set.coAuth, _set.editPivot] lock : [_set.lostConnect, _set.coAuth, _set.editPivot, _set.selRangeEdit]
}); });
this.btnPivotLayout = new Common.UI.Button({ this.btnPivotLayout = new Common.UI.Button({
@ -191,7 +191,7 @@ define([
iconCls : 'toolbar__icon btn-pivot-layout', iconCls : 'toolbar__icon btn-pivot-layout',
caption : this.capLayout, caption : this.capLayout,
disabled : true, disabled : true,
lock : [_set.lostConnect, _set.coAuth, _set.noPivot], lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit],
menu : true menu : true
}); });
this.lockedControls.push(this.btnPivotLayout); this.lockedControls.push(this.btnPivotLayout);
@ -201,7 +201,7 @@ define([
iconCls : 'toolbar__icon btn-blank-rows', iconCls : 'toolbar__icon btn-blank-rows',
caption : this.capBlankRows, caption : this.capBlankRows,
disabled : true, disabled : true,
lock : [_set.lostConnect, _set.coAuth, _set.noPivot], lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit],
menu : true menu : true
}); });
this.lockedControls.push(this.btnPivotBlankRows); this.lockedControls.push(this.btnPivotBlankRows);
@ -211,7 +211,7 @@ define([
iconCls : 'toolbar__icon btn-subtotals', iconCls : 'toolbar__icon btn-subtotals',
caption : this.capSubtotals, caption : this.capSubtotals,
disabled : true, disabled : true,
lock : [_set.lostConnect, _set.coAuth, _set.noPivot], lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit],
menu : true menu : true
}); });
this.lockedControls.push(this.btnPivotSubtotals); this.lockedControls.push(this.btnPivotSubtotals);
@ -221,7 +221,7 @@ define([
iconCls : 'toolbar__icon btn-grand-totals', iconCls : 'toolbar__icon btn-grand-totals',
caption : this.capGrandTotals, caption : this.capGrandTotals,
disabled : true, disabled : true,
lock : [_set.lostConnect, _set.coAuth, _set.noPivot], lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit],
menu : true menu : true
}); });
this.lockedControls.push(this.btnPivotGrandTotals); this.lockedControls.push(this.btnPivotGrandTotals);
@ -231,7 +231,7 @@ define([
iconCls: 'toolbar__icon btn-update', iconCls: 'toolbar__icon btn-update',
caption: this.txtRefresh, caption: this.txtRefresh,
disabled : true, disabled : true,
lock : [_set.lostConnect, _set.coAuth, _set.noPivot] lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit]
}); });
this.lockedControls.push(this.btnRefreshPivot); this.lockedControls.push(this.btnRefreshPivot);
@ -239,7 +239,7 @@ define([
cls: 'btn-toolbar x-huge icon-top', cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-select-pivot', iconCls: 'toolbar__icon btn-select-pivot',
caption: this.txtSelect, caption: this.txtSelect,
lock: [_set.lostConnect, _set.coAuth, _set.noPivot] lock: [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit]
}); });
this.lockedControls.push(this.btnSelectPivot); this.lockedControls.push(this.btnSelectPivot);
@ -249,7 +249,7 @@ define([
itemWidth : 61, itemWidth : 61,
itemHeight : 49, itemHeight : 49,
menuMaxHeight : 300, menuMaxHeight : 300,
lock : [_set.lostConnect, _set.coAuth, _set.noPivot], lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit],
beforeOpenHandler: function(e) { beforeOpenHandler: function(e) {
var cmp = this, var cmp = this,
menu = cmp.openButton.menu; menu = cmp.openButton.menu;

View file

@ -91,7 +91,8 @@ define([
multiselectCols:'is-multiselect-cols', multiselectCols:'is-multiselect-cols',
headerLock: 'header-lock', headerLock: 'header-lock',
sheetLock: 'sheet-lock', sheetLock: 'sheet-lock',
noPivot: 'no-pivot' noPivot: 'no-pivot',
noSubitems: 'no-subitems'
}; };
SSE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend({ SSE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend({
@ -1036,7 +1037,7 @@ define([
cls: 'btn-toolbar x-huge icon-top', cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-pageorient', iconCls: 'toolbar__icon btn-pageorient',
caption: me.capBtnPageOrient, caption: me.capBtnPageOrient,
lock : [_set.docPropsLock, _set.lostConnect, _set.coAuth], lock : [_set.docPropsLock, _set.lostConnect, _set.coAuth, _set.selRangeEdit],
menu: new Common.UI.Menu({ menu: new Common.UI.Menu({
cls: 'ppm-toolbar', cls: 'ppm-toolbar',
items: [ items: [
@ -1073,7 +1074,7 @@ define([
cls: 'btn-toolbar x-huge icon-top', cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-pagemargins', iconCls: 'toolbar__icon btn-pagemargins',
caption: me.capBtnMargins, caption: me.capBtnMargins,
lock : [_set.docPropsLock, _set.lostConnect, _set.coAuth], lock : [_set.docPropsLock, _set.lostConnect, _set.coAuth, _set.selRangeEdit],
menu: new Common.UI.Menu({ menu: new Common.UI.Menu({
items: [ items: [
{ {
@ -1118,7 +1119,7 @@ define([
cls: 'btn-toolbar x-huge icon-top', cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-pagesize', iconCls: 'toolbar__icon btn-pagesize',
caption: me.capBtnPageSize, caption: me.capBtnPageSize,
lock : [_set.docPropsLock, _set.lostConnect, _set.coAuth], lock : [_set.docPropsLock, _set.lostConnect, _set.coAuth, _set.selRangeEdit],
menu: new Common.UI.Menu({ menu: new Common.UI.Menu({
restoreHeight: true, restoreHeight: true,
items: [ items: [
@ -1280,7 +1281,7 @@ define([
cls: 'btn-toolbar x-huge icon-top', cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-scale', iconCls: 'toolbar__icon btn-scale',
caption: me.capBtnScale, caption: me.capBtnScale,
lock: [_set.docPropsLock, _set.lostConnect, _set.coAuth], lock: [_set.docPropsLock, _set.lostConnect, _set.coAuth, _set.selRangeEdit],
menu: new Common.UI.Menu({ menu: new Common.UI.Menu({
items: [], items: [],
cls: 'scale-menu'}) cls: 'scale-menu'})
@ -1343,7 +1344,7 @@ define([
cls: 'btn-toolbar x-huge icon-top', cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-print-titles', iconCls: 'toolbar__icon btn-print-titles',
caption: me.capBtnPrintTitles, caption: me.capBtnPrintTitles,
lock : [_set.docPropsLock, _set.lostConnect, _set.coAuth] lock : [_set.docPropsLock, _set.lostConnect, _set.coAuth, _set.selRangeEdit]
}); });
me.btnImgAlign = new Common.UI.Button({ me.btnImgAlign = new Common.UI.Button({