[DE] Change opening right panel tabs for form controls

This commit is contained in:
Julia Radzhabova 2020-12-23 13:09:02 +03:00
parent b06f78acc0
commit 1120a1eaa2
2 changed files with 45 additions and 2 deletions

View file

@ -60,6 +60,8 @@ define([
'rightmenuclick': this.onRightMenuClick
}
});
Common.Utils.InternalSettings.set("de-rightpanel-active-form", 1);
},
onLaunch: function() {
@ -95,8 +97,29 @@ define([
this.editMode = mode.isEdit;
},
onRightMenuClick: function(menu, type, minimized) {
onRightMenuClick: function(menu, type, minimized, event) {
if (!minimized && this.editMode) {
if (event) { // user click event
if (!this._settings[Common.Utils.documentSettingsType.Form].hidden) {
if (type == Common.Utils.documentSettingsType.Form) {
if (!this._settings[Common.Utils.documentSettingsType.Paragraph].hidden)
Common.Utils.InternalSettings.set("de-rightpanel-active-para", 0);
if (!this._settings[Common.Utils.documentSettingsType.Image].hidden)
Common.Utils.InternalSettings.set("de-rightpanel-active-image", 0);
if (!this._settings[Common.Utils.documentSettingsType.Shape].hidden)
Common.Utils.InternalSettings.set("de-rightpanel-active-shape", 0);
} else if (type == Common.Utils.documentSettingsType.Paragraph) {
Common.Utils.InternalSettings.set("de-rightpanel-active-para", 2);
} else if (type == Common.Utils.documentSettingsType.Image) {
Common.Utils.InternalSettings.set("de-rightpanel-active-image", 2);
Common.Utils.InternalSettings.set("de-rightpanel-active-shape", 0);
} else if (type == Common.Utils.documentSettingsType.Shape) {
Common.Utils.InternalSettings.set("de-rightpanel-active-shape", 2);
Common.Utils.InternalSettings.set("de-rightpanel-active-image", 0);
}
}
}
var panel = this._settings[type].panel;
var props = this._settings[type].props;
if (props && panel)
@ -223,6 +246,26 @@ define([
if (!this.rightmenu.minimizedMode || open) {
var active;
if (priorityactive<0 && !this._settings[Common.Utils.documentSettingsType.Form].hidden &&
(!this._settings[Common.Utils.documentSettingsType.Paragraph].hidden || !this._settings[Common.Utils.documentSettingsType.Image].hidden
|| !this._settings[Common.Utils.documentSettingsType.Shape].hidden)) {
var imageactive = Common.Utils.InternalSettings.get("de-rightpanel-active-image") || 0,
shapeactive = Common.Utils.InternalSettings.get("de-rightpanel-active-shape") || 0,
paraactive = Common.Utils.InternalSettings.get("de-rightpanel-active-para") || 0,
formactive = Common.Utils.InternalSettings.get("de-rightpanel-active-form") || 0;
if (!this._settings[Common.Utils.documentSettingsType.Paragraph].hidden) {
priorityactive = (formactive>paraactive) ? Common.Utils.documentSettingsType.Form : Common.Utils.documentSettingsType.Paragraph;
} else if (!this._settings[Common.Utils.documentSettingsType.Paragraph].Image || !this._settings[Common.Utils.documentSettingsType.Shape].hidden) {
if (formactive>shapeactive && formactive>imageactive)
priorityactive = Common.Utils.documentSettingsType.Form;
else if (shapeactive>formactive && shapeactive>imageactive)
priorityactive = Common.Utils.documentSettingsType.Shape;
else
priorityactive = Common.Utils.documentSettingsType.Image;
}
}
if (priorityactive>-1) active = priorityactive;
else if (lastactive>=0 && currentactive<0) active = lastactive;
else if (currentactive>=0) active = currentactive;

View file

@ -293,7 +293,7 @@ define([
Common.localStorage.setItem("de-hide-right-settings", 1);
}
this.fireEvent('rightmenuclick', [this, btn.options.asctype, this.minimizedMode]);
this.fireEvent('rightmenuclick', [this, btn.options.asctype, this.minimizedMode, e]);
},
SetActivePane: function(type, open) {