Shared:ContextMenu:Fixed so that the context menu in any resolution will always have nesting.

This commit is contained in:
Vlada Gazizova 2024-05-23 12:20:34 +03:00
parent 6d62c18b44
commit e6e05b83ab

View File

@ -1066,8 +1066,7 @@ class ContextOptionsStore {
!contextOptions.includes("finalize-version") &&
contextOptions.includes("show-version-history");
const versionActions = isDesktop()
? onlyShowVersionHistory
const versionActions = onlyShowVersionHistory
? [
{
id: "option_show-version-history",
@ -1116,35 +1115,9 @@ class ContextOptionsStore {
},
],
},
]
: [
{
id: "option_finalize-version",
key: "finalize-version",
label: t("FinalizeVersion"),
icon: HistoryFinalizedReactSvgUrl,
onClick: () =>
isEditing
? this.onShowEditingToast(t)
: this.finalizeVersion(item.id),
disabled: false,
},
{
id: "option_version-history",
key: "show-version-history",
label: t("ShowVersionHistory"),
icon: HistoryReactSvgUrl,
onClick: () =>
this.showVersionHistory(
item.id,
item.security,
item?.requestToken,
),
disabled: false,
},
];
const moveActions =
isDesktop() && !isInfoPanel
const moveActions = !isInfoPanel
? [
{
id: "option_move-or-copy",
@ -1605,7 +1578,7 @@ class ContextOptionsStore {
const pluginItems = this.onLoadPlugins(item);
if (pluginItems.length > 0) {
if (!isDesktop() || pluginItems.length === 1) {
if (pluginItems.length === 1) {
pluginItems.forEach((plugin) => {
options.splice(1, 0, {
id: `option_${plugin.key}`,