feat(Modeler): expose Viewer and NavigatedViewer constructors
This allows bundled users (f.ex without browserify) to use the modeler + viewers easily without having to monkey patch or load more than one bundled file. Closes #541
This commit is contained in:
parent
006be69d63
commit
62d9b6f993
|
@ -6,6 +6,8 @@ var Ids = require('ids');
|
|||
|
||||
var Viewer = require('./Viewer');
|
||||
|
||||
var NavigatedViewer = require('./NavigatedViewer');
|
||||
|
||||
var initialDiagram =
|
||||
'<?xml version="1.0" encoding="UTF-8"?>' +
|
||||
'<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
|
||||
|
@ -118,6 +120,10 @@ inherits(Modeler, Viewer);
|
|||
|
||||
module.exports = Modeler;
|
||||
|
||||
module.exports.Viewer = Viewer;
|
||||
|
||||
module.exports.NavigatedViewer = NavigatedViewer;
|
||||
|
||||
/**
|
||||
* Create a new diagram to start modeling.
|
||||
*
|
||||
|
|
|
@ -399,4 +399,16 @@ describe('Modeler', function() {
|
|||
|
||||
});
|
||||
|
||||
|
||||
it('should expose Viewer and NavigatedViewer', function() {
|
||||
|
||||
// given
|
||||
var Viewer = require('../../lib/Viewer');
|
||||
var NavigatedViewer = require('../../lib/NavigatedViewer');
|
||||
|
||||
// then
|
||||
expect(Modeler.Viewer).to.equal(Viewer);
|
||||
expect(Modeler.NavigatedViewer).to.equal(NavigatedViewer);
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue