Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Some shapes aren't visible in the left panel #182 #205

Merged
merged 2 commits into from
Aug 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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