Skip to content

Commit

Permalink
fix(cockpit): skip loading plugins for not yet intialized tables
Browse files Browse the repository at this point in the history
related to CAM-13950, closes camunda#1628
  • Loading branch information
tasso94 authored Sep 27, 2021
1 parent ef0517c commit 376d2f3
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,19 @@ module.exports = [
viewer.on('import.done', function() {
viewer.getActiveViewer().on('element.click', function(e) {
$scope.$apply(function() {
$scope.onClick({element: e.element, $event: e.originalEvent});
$scope.onClick({
element: e.element,
$event: e.originalEvent
});
});
});

viewer.getActiveViewer().on('element.dblclick', function(e) {
$scope.$apply(function() {
$scope.onDblClick({element: e.element, $event: e.originalEvent});
$scope.onDblClick({
element: e.element,
$event: e.originalEvent
});
});
});
});
Expand Down Expand Up @@ -303,8 +309,9 @@ module.exports = [
$scope.loaded = false;

viewer.importXML(correctedXML, function(err) {
const isTable = () => angular.isDefined($scope.table); // variable can be empty if table name is yet not initialized (e.g., pending request)
$scope.isDrd =
viewer.getDefinitions().drgElement.length > 1 && !$scope.table;
viewer.getDefinitions().drgElement.length > 1 && !isTable();

if ($scope.isDrd) {
canvas = viewer.getActiveViewer().get('canvas');
Expand Down

0 comments on commit 376d2f3

Please sign in to comment.