From f74426c9549413fe09b0fd591b622d4273d5f7e9 Mon Sep 17 00:00:00 2001 From: Timo Dittmann Date: Wed, 25 Nov 2020 08:56:32 +0100 Subject: [PATCH] Allow group of multiple different elements --- src/js/method-draw.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/js/method-draw.js b/src/js/method-draw.js index 550e048..e6871c9 100644 --- a/src/js/method-draw.js +++ b/src/js/method-draw.js @@ -141,7 +141,7 @@ window.methodDraw = function() { }; // called when we've selected a different element - var selectedChanged = function(window,elems) { + var selectedChanged = function(window,elems) { var mode = svgCanvas.getMode(); if(mode === "select") setSelectMode(); if (mode === "pathedit") return updateContextPanel(); @@ -167,6 +167,11 @@ window.methodDraw = function() { $('#canvas_panel').show() $('#tools_top').removeClass('multiselected') } + + // We need to update the context panel always when we've selected a different element. Otherwise some + // menu items are disabled even if they shouldn't be (e.g. group multiple elements) + updateContextPanel(); + svgCanvas.runExtensions("selectedChanged", { elems: elems, selectedElement: selectedElement, @@ -678,7 +683,7 @@ window.methodDraw = function() { } if (!elem) { - menu_items.disableContextMenuItems('#delete,#cut,#copy,#group,#ungroup,#move_front,#move_up,#move_down,#move_back'); + menu_items.disableContextMenuItems('#delete,#cut,#copy,#ungroup,#move_front,#move_up,#move_down,#move_back'); } // update history buttons @@ -2683,4 +2688,4 @@ window.methodDraw = function() { }(jQuery); // Run init once DOM is loaded -$(methodDraw.init); \ No newline at end of file +$(methodDraw.init);