chore(contextPadProvider): adjust popupMenu method calls
Since breaking changes were introduced in diagram-js popupMenu methos calls need to be adjusted * call popupMenu#open with element, id and position as params * call popupMenu#isEmpty with element and providerId as params * remove popupMenu#create call
This commit is contained in:
parent
6b2d4b47da
commit
17896df65c
|
@ -329,14 +329,7 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
|
|||
}
|
||||
}
|
||||
|
||||
var replaceMenu;
|
||||
|
||||
if (popupMenu._providers['bpmn-replace']) {
|
||||
replaceMenu = popupMenu.create('bpmn-replace', element);
|
||||
}
|
||||
|
||||
if (replaceMenu && !replaceMenu.isEmpty()) {
|
||||
|
||||
if (!popupMenu.isEmpty(element, 'bpmn-replace')) {
|
||||
// Replace menu entry
|
||||
assign(actions, {
|
||||
'replace': {
|
||||
|
@ -345,9 +338,12 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
|
|||
title: translate('Change type'),
|
||||
action: {
|
||||
click: function(event, element) {
|
||||
replaceMenu.open(assign(getReplaceMenuPosition(element), {
|
||||
|
||||
var position = assign(getReplaceMenuPosition(element), {
|
||||
cursor: { x: event.x, y: event.y }
|
||||
}), element);
|
||||
});
|
||||
|
||||
popupMenu.open(element, 'bpmn-replace', position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,9 +76,9 @@ describe('features/popup-menu - replace menu provider', function() {
|
|||
|
||||
getBpmnJS().invoke(function(popupMenu) {
|
||||
|
||||
popupMenu.create('bpmn-replace', element);
|
||||
|
||||
popupMenu.open({ x: element.x + offset, y: element.y + offset });
|
||||
popupMenu.open(element, 'bpmn-replace', {
|
||||
x: element.x + offset, y: element.y + offset
|
||||
});
|
||||
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue