Skip to content
Open
Show file tree
Hide file tree
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
22 changes: 20 additions & 2 deletions client/PropertyInfoPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var _ = require('lodash');

var elementOverlays = [];
var overlaysVisible = true;
var docNotesVisible = false;

function PropertyInfoPlugin(eventBus, overlays, elementRegistry, editorActions) {

Expand Down Expand Up @@ -34,6 +35,12 @@ function PropertyInfoPlugin(eventBus, overlays, elementRegistry, editorActions)
}
});

editorActions.register({
togglePropertyDocNotes: function () {
toggleDocNotes();
}
});

function changeShape(event) {
var element = event.element;
if (!(element.businessObject.$instanceOf('bpmn:FlowNode') || element.businessObject.$instanceOf('bpmn:Participant'))) {
Expand Down Expand Up @@ -75,6 +82,14 @@ function PropertyInfoPlugin(eventBus, overlays, elementRegistry, editorActions)
}
}

function toggleDocNotes() {
if (overlaysVisible) {
docNotesVisible = !docNotesVisible;
overlaysVisible = false;
toggleOverlays();
}
}

function addStyle(element) {

if (elementOverlays[element.id] !== undefined && elementOverlays[element.id].length !== 0) {
Expand All @@ -93,14 +108,17 @@ function PropertyInfoPlugin(eventBus, overlays, elementRegistry, editorActions)
var text = element.businessObject.documentation[0].text;
text = text.replace(/(?:\r\n|\r|\n)/g, '<br />');


var noteClass = "doc-val-hover";
if (docNotesVisible) {
noteClass += " doc-val-visible-note";
}
elementOverlays[element.id].push(
overlays.add(element, 'badge', {
position: {
top: 4,
right: 4
},
html: '<div class="doc-val-true" data-badge="D"></div><div class="doc-val-hover" data-badge="D">'+text+'</div>'
html: '<div class="doc-val-true" data-badge="D"></div><div class="'+noteClass+'" data-badge="D">'+text+'</div>'
}));
}

Expand Down
Loading