mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-01-11 17:44:12 +00:00
chore(Viewer): re-expose loaded definitions
The previous release kinda removed access to the currently loaded definitions. This restores access by exposing it by `Viewer#getDefinitions()`.
This commit is contained in:
parent
6bb1128ccc
commit
2ef82970fd
@ -378,6 +378,10 @@ Viewer.prototype.attachTo = function(parentNode) {
|
||||
this._emit('attach', {});
|
||||
};
|
||||
|
||||
Viewer.prototype.getDefinitions = function() {
|
||||
return this._definitions;
|
||||
};
|
||||
|
||||
Viewer.prototype.detach = function() {
|
||||
|
||||
var container = this._container,
|
||||
|
@ -29,7 +29,21 @@ describe('Viewer', function() {
|
||||
|
||||
it('should import simple process', function(done) {
|
||||
var xml = require('../fixtures/bpmn/simple.bpmn');
|
||||
createViewer(xml, done);
|
||||
|
||||
// when
|
||||
createViewer(xml, function(err, warnings, viewer) {
|
||||
|
||||
// then
|
||||
expect(err).not.to.exist;
|
||||
expect(warnings).to.be.empty;
|
||||
|
||||
var definitions = viewer.getDefinitions();
|
||||
|
||||
expect(definitions).to.exist;
|
||||
expect(definitions).to.eql(viewer._definitions);
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user