Skip to content

Commit

Permalink
feat(preview-support): add public cleanUp API
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme authored and nikku committed Oct 12, 2023
1 parent 0941c37 commit 99b734e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/features/preview-support/PreviewSupport.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ export default function PreviewSupport(elementRegistry, eventBus, canvas, styles
var self = this;

eventBus.on('drag.cleanup', function() {
forEach(self._clonedMarkers, function(clonedMarker) {
svgRemove(clonedMarker);
});

self._clonedMarkers = {};
self.cleanUp();
});
}

Expand All @@ -76,6 +72,15 @@ PreviewSupport.$inject = [
'styles'
];

PreviewSupport.prototype.cleanUp = function() {
var self = this;

forEach(self._clonedMarkers, function(clonedMarker) {
svgRemove(clonedMarker);
});

self._clonedMarkers = {};
};

/**
* Returns graphics of an element.
Expand Down

0 comments on commit 99b734e

Please sign in to comment.