Skip to content

Commit

Permalink
Some shapes aren't visible in the left panel #182 (#205)
Browse files Browse the repository at this point in the history
* consider the basePath for the shapes added in the left panel
  • Loading branch information
oanalavinia authored Aug 20, 2021
1 parent 98d769f commit d99f193
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
//
Expand Down

0 comments on commit d99f193

Please # to comment.