feat(preview-support): decouple the shared preview logic
This commit is contained in:
parent
73487358a9
commit
0f4dbb32bd
|
@ -9,7 +9,7 @@ var assign = require('lodash/object/assign'),
|
||||||
|
|
||||||
var LOW_PRIORITY = 250;
|
var LOW_PRIORITY = 250;
|
||||||
|
|
||||||
function BpmnReplacePreview(eventBus, elementRegistry, elementFactory, canvas, movePreview) {
|
function BpmnReplacePreview(eventBus, elementRegistry, elementFactory, canvas, previewSupport) {
|
||||||
|
|
||||||
CommandInterceptor.call(this, eventBus);
|
CommandInterceptor.call(this, eventBus);
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ function BpmnReplacePreview(eventBus, elementRegistry, elementFactory, canvas, m
|
||||||
}
|
}
|
||||||
|
|
||||||
// clone the gfx of the temporary shape and add it to the drag group
|
// clone the gfx of the temporary shape and add it to the drag group
|
||||||
var dragger = movePreview.addDragger(tempShape, context.dragGroup);
|
var dragger = previewSupport.addDragger(tempShape, context.dragGroup);
|
||||||
|
|
||||||
context.visualReplacements[id] = dragger;
|
context.visualReplacements[id] = dragger;
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ function BpmnReplacePreview(eventBus, elementRegistry, elementFactory, canvas, m
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
BpmnReplacePreview.$inject = [ 'eventBus', 'elementRegistry', 'elementFactory', 'canvas', 'movePreview' ];
|
BpmnReplacePreview.$inject = [ 'eventBus', 'elementRegistry', 'elementFactory', 'canvas', 'previewSupport' ];
|
||||||
|
|
||||||
inherits(BpmnReplacePreview, CommandInterceptor);
|
inherits(BpmnReplacePreview, CommandInterceptor);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
__depends__: [ require('diagram-js/lib/features/move') ],
|
__depends__: [ require('diagram-js/lib/features/preview-support') ],
|
||||||
__init__: ['bpmnReplacePreview'],
|
__init__: [ 'bpmnReplacePreview' ],
|
||||||
bpmnReplacePreview: [ 'type', require('./BpmnReplacePreview') ]
|
bpmnReplacePreview: [ 'type', require('./BpmnReplacePreview') ]
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue