From d99f193ed189e6ecec39ff8621e7f704ab931ddb Mon Sep 17 00:00:00 2001 From: Oana-Lavinia Florean Date: Fri, 20 Aug 2021 14:05:59 +0300 Subject: [PATCH] Some shapes aren't visible in the left panel #182 (#205) * consider the basePath for the shapes added in the left panel --- .../src/main/resources/Diagram/DiagramEditSheet.xml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/application-diagram-ui/src/main/resources/Diagram/DiagramEditSheet.xml b/application-diagram-ui/src/main/resources/Diagram/DiagramEditSheet.xml index 4d4c7e6..4a4298b 100644 --- a/application-diagram-ui/src/main/resources/Diagram/DiagramEditSheet.xml +++ b/application-diagram-ui/src/main/resources/Diagram/DiagramEditSheet.xml @@ -1292,11 +1292,12 @@ define('diagram-editor', [ 'diagram-store', 'diagram-utils', 'diagram-url-io', + 'diagram-config', 'diagram-graph-xml-filter', 'diagram-link-editor', 'diagram-image-editor', 'diagram-external-services' -], function($, diagramStore, diagramUtils, diagramUrlIO) { +], function($, diagramStore, diagramUtils, diagramUrlIO, diagramConfig) { // These variables are used to decide if an image should be uploaded at original resolution or // should be declined for being too big. @@ -1437,6 +1438,15 @@ define('diagram-editor', [ return {x: offset.left, y: offset.top}; }; + // + // Consider the basePath for the shapes added in the left panel. + // + var oldCreateVertexTemplateEntry = Sidebar.prototype.createVertexTemplateEntry; + Sidebar.prototype.createVertexTemplateEntry = function(style, width, height, value, title, showLabel, showTitle, tags) { + style = style.replace(/(image=)(img\/lib)/g, '$1' + diagramConfig.drawIOBasePath + '$2'); + return oldCreateVertexTemplateEntry.call(this, style, width, height, value, title, showLabel, showTitle, tags); + }; + // // Overwrite the Keyboard Shortcuts action because it uses the wrong URL. //