Skip to content

Commit

Permalink
fix: use getDi for Camunda Modeler 5 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac committed Aug 29, 2022
1 parent 9723313 commit 8bdaf8e
Show file tree
Hide file tree
Showing 4 changed files with 1,243 additions and 12 deletions.
11 changes: 5 additions & 6 deletions client/ColorPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var domify = require('min-dom/lib/domify');
var ColorPicker = require('simple-color-picker');
var getDi = require('bpmn-js/lib/util/ModelUtil').getDi;

function ColorPlugin(eventBus, bpmnRules, editorActions, canvas, commandStack) {
var self = this;
Expand All @@ -23,12 +24,10 @@ function ColorPlugin(eventBus, bpmnRules, editorActions, canvas, commandStack) {
}

ColorPlugin.prototype._getColor = function(element) {
if (element != null && element.businessObject != null) {
var businessObject = element.businessObject;
if (businessObject.di != null && businessObject.di.fill != null) {
return businessObject.di.fill;
self.colorPicker.setColor(businessObject.di.fill);
}
if (element != null) {
var di = getDi(element);

return di && di.get('fill') || null;
}
return null;
}
Expand Down
Loading

0 comments on commit 8bdaf8e

Please # to comment.