From 195fef4ff4f076771fdc4600b3ffa35b5eea3bc7 Mon Sep 17 00:00:00 2001 From: bordun Date: Wed, 30 Sep 2020 13:45:14 +0200 Subject: [PATCH] editor: move position menu --- src/client/editor/context-menu.js | 82 ++++++++++++++++--------------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/src/client/editor/context-menu.js b/src/client/editor/context-menu.js index a0dcd960..1a71757b 100644 --- a/src/client/editor/context-menu.js +++ b/src/client/editor/context-menu.js @@ -72,45 +72,6 @@ var handleClick = function(event) { } - if (editor.selectedWidgets[0].parent.children.length > 1) { - actions.push({ - label: icon('layer-group') + ' Position', - action: [ - { - label: locales('editor_back'), - action: ()=>{ - editor.handleKeyboard('home') - }, - shortcut: 'Home' - }, - { - label: locales('editor_farther'), - action: ()=>{ - editor.handleKeyboard('pageup') - }, - shortcut: 'Page Up' - }, - { - label: locales('editor_closer'), - action: ()=>{ - editor.handleKeyboard('pagedown') - }, - shortcut: 'Page Down' - }, - { - label: locales('editor_front'), - action: ()=>{ - editor.handleKeyboard('end') - }, - shortcut: 'End' - } - ] - }) - actions.push({ - separator: true - }) - } - actions.push({ label: icon('copy') + ' ' + locales('editor_copy'), action: editor.copyWidget.bind(editor), @@ -174,6 +135,49 @@ var handleClick = function(event) { } + } + + if (parent !== widgetManager && editor.selectedWidgets[0].parent.children.length > 1) { + actions.push({ + separator: true + }) + actions.push({ + label: icon('layer-group') + ' Position', + action: [ + { + label: locales('editor_back'), + action: ()=>{ + editor.handleKeyboard('home') + }, + shortcut: 'Home' + }, + { + label: locales('editor_farther'), + action: ()=>{ + editor.handleKeyboard('pageup') + }, + shortcut: 'Page Up' + }, + { + label: locales('editor_closer'), + action: ()=>{ + editor.handleKeyboard('pagedown') + }, + shortcut: 'Page Down' + }, + { + label: locales('editor_front'), + action: ()=>{ + editor.handleKeyboard('end') + }, + shortcut: 'End' + } + ] + }) + + } + + if (widget.childrenType !== undefined) { var addActions = []