[SSE] Fix Bug 46122, Bug 46083

This commit is contained in:
Julia Radzhabova 2020-08-13 22:11:20 +03:00
parent 0851ee9036
commit 417a1767ef

View file

@ -71,11 +71,14 @@ define([
'insertpivot': this.onInsertPivot
}
});
Common.Utils.InternalSettings.set("sse-rightpanel-active-table", 1);
Common.Utils.InternalSettings.set("sse-rightpanel-active-pivot", 1);
Common.Utils.InternalSettings.set("sse-rightpanel-active-spark", 1);
},
onLaunch: function() {
this.rightmenu = this.createView('RightMenu');
this.rightmenu.on('render:after', _.bind(this.onRightMenuAfterRender, this));
},
@ -111,15 +114,17 @@ define([
if (!minimized && this.editMode) {
if (event) { // user click event
if (type == Common.Utils.documentSettingsType.Table) {
Common.Utils.InternalSettings.set("sse-rightpanel-active-table", 1);
if (!this._settings[Common.Utils.documentSettingsType.Chart].hidden)
Common.Utils.InternalSettings.set("sse-rightpanel-active-spark", 0);
Common.Utils.InternalSettings.set("sse-rightpanel-active-table", 2);
if (!this._settings[Common.Utils.documentSettingsType.Chart].hidden) {
Common.Utils.InternalSettings.set("sse-rightpanel-active-spark", Math.min(Common.Utils.InternalSettings.get("sse-rightpanel-active-spark"), 1));
}
} else if (type == Common.Utils.documentSettingsType.Pivot)
Common.Utils.InternalSettings.set("sse-rightpanel-active-pivot", 1);
else if (type == Common.Utils.documentSettingsType.Chart && !this._settings[Common.Utils.documentSettingsType.Cell].hidden) {//sparkline
Common.Utils.InternalSettings.set("sse-rightpanel-active-spark", 1);
if (!this._settings[Common.Utils.documentSettingsType.Table].hidden)
Common.Utils.InternalSettings.set("sse-rightpanel-active-table", 0);
Common.Utils.InternalSettings.set("sse-rightpanel-active-spark", 2);
if (!this._settings[Common.Utils.documentSettingsType.Table].hidden) {
Common.Utils.InternalSettings.set("sse-rightpanel-active-table", Math.min(Common.Utils.InternalSettings.get("sse-rightpanel-active-table"), 1));
}
} else if (Common.Utils.documentSettingsType.Cell) {
if (!this._settings[Common.Utils.documentSettingsType.Table].hidden)
Common.Utils.InternalSettings.set("sse-rightpanel-active-table", 0);
@ -269,15 +274,21 @@ define([
if (priorityactive<0 && !this._settings[Common.Utils.documentSettingsType.Cell].hidden &&
(!this._settings[Common.Utils.documentSettingsType.Table].hidden || !this._settings[Common.Utils.documentSettingsType.Pivot].hidden ||
!this._settings[Common.Utils.documentSettingsType.Chart].hidden)) {
var tableactive = !!Common.Utils.InternalSettings.get("sse-rightpanel-active-table") && !this._settings[Common.Utils.documentSettingsType.Table].hidden,
pivotactive = !!Common.Utils.InternalSettings.get("sse-rightpanel-active-pivot") && !this._settings[Common.Utils.documentSettingsType.Pivot].hidden,
sparkactive = !!Common.Utils.InternalSettings.get("sse-rightpanel-active-spark") && !this._settings[Common.Utils.documentSettingsType.Chart].hidden;
if (!this._settings[Common.Utils.documentSettingsType.Table].hidden)
priorityactive = !tableactive ? (sparkactive ? Common.Utils.documentSettingsType.Chart : Common.Utils.documentSettingsType.Cell) : Common.Utils.documentSettingsType.Table;
if (!this._settings[Common.Utils.documentSettingsType.Chart].hidden)
priorityactive = !sparkactive ? (tableactive ? Common.Utils.documentSettingsType.Table : Common.Utils.documentSettingsType.Cell) : Common.Utils.documentSettingsType.Chart;
var tableactive = Common.Utils.InternalSettings.get("sse-rightpanel-active-table"),
pivotactive = Common.Utils.InternalSettings.get("sse-rightpanel-active-pivot"),
sparkactive = Common.Utils.InternalSettings.get("sse-rightpanel-active-spark");
if (!this._settings[Common.Utils.documentSettingsType.Table].hidden && !this._settings[Common.Utils.documentSettingsType.Chart].hidden) {
if (tableactive == sparkactive)
priorityactive = (tableactive===0) ? Common.Utils.documentSettingsType.Cell : Common.Utils.documentSettingsType.Chart;
else
priorityactive = (tableactive > sparkactive) ? Common.Utils.documentSettingsType.Table : Common.Utils.documentSettingsType.Chart;
} else if (!this._settings[Common.Utils.documentSettingsType.Table].hidden) {
priorityactive = (tableactive===0) ? Common.Utils.documentSettingsType.Cell : Common.Utils.documentSettingsType.Table;
} else if (!this._settings[Common.Utils.documentSettingsType.Chart].hidden) {
priorityactive = (sparkactive===0) ? Common.Utils.documentSettingsType.Cell : Common.Utils.documentSettingsType.Chart;
}
if (!this._settings[Common.Utils.documentSettingsType.Pivot].hidden)
priorityactive = !pivotactive ? Common.Utils.documentSettingsType.Cell : Common.Utils.documentSettingsType.Pivot;
priorityactive = (pivotactive===0) ? Common.Utils.documentSettingsType.Cell : Common.Utils.documentSettingsType.Pivot;
}
if (priorityactive>-1) active = priorityactive;