Skip to content

Commit

Permalink
Fix to only add known elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Bösch committed Jul 5, 2017
1 parent 5aecffe commit 7a1a35b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

This plugin serves a better overview which properties are set per shape.

![Plugin-Example](./plugin-example.png)

## How to install

Put this directory into the plugins directory of the Camunda Modeler and you're ready to go.
Expand Down
20 changes: 11 additions & 9 deletions client/ClientPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function ClientPlugin(eventBus, overlays, elementRegistry, editorActions) {
}
});

function removeShape(element){
function removeShape(element) {
var elementObject = elementOverlays[element.id];
for (var overlay in elementObject) {
overlays.remove(elementObject[overlay]);
Expand Down Expand Up @@ -96,7 +96,7 @@ function ClientPlugin(eventBus, overlays, elementRegistry, editorActions) {
var background = '';
var location = 'right';
var sort = 0;
var key;
var key = '';

switch (extensions[extension].$type) {
case 'camunda:ExecutionListener':
Expand Down Expand Up @@ -189,13 +189,15 @@ function ClientPlugin(eventBus, overlays, elementRegistry, editorActions) {
});
}
} else {
badges.push({
badgeKey: key,
badgeSort: sort,
badgeType: type,
badgeBackground: background,
badgeLocation: location
});
if (key !== '') {
badges.push({
badgeKey: key,
badgeSort: sort,
badgeType: type,
badgeBackground: background,
badgeLocation: location
});
}
}


Expand Down
20 changes: 11 additions & 9 deletions client/client-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function ClientPlugin(eventBus, overlays, elementRegistry, editorActions) {
}
});

function removeShape(element){
function removeShape(element) {
var elementObject = elementOverlays[element.id];
for (var overlay in elementObject) {
overlays.remove(elementObject[overlay]);
Expand Down Expand Up @@ -97,7 +97,7 @@ function ClientPlugin(eventBus, overlays, elementRegistry, editorActions) {
var background = '';
var location = 'right';
var sort = 0;
var key;
var key = '';

switch (extensions[extension].$type) {
case 'camunda:ExecutionListener':
Expand Down Expand Up @@ -190,13 +190,15 @@ function ClientPlugin(eventBus, overlays, elementRegistry, editorActions) {
});
}
} else {
badges.push({
badgeKey: key,
badgeSort: sort,
badgeType: type,
badgeBackground: background,
badgeLocation: location
});
if (key !== '') {
badges.push({
badgeKey: key,
badgeSort: sort,
badgeType: type,
badgeBackground: background,
badgeLocation: location
});
}
}


Expand Down
Binary file added plugin-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7a1a35b

Please sign in to comment.