chore(modeling): remove custom shape.append handler
This commit is contained in:
parent
a301acc4c4
commit
2c5548423b
|
@ -8,7 +8,7 @@ var CreateShapeHandler = require('diagram-js/lib/features/modeling/cmd/CreateSha
|
||||||
DeleteShapeHandler = require('diagram-js/lib/features/modeling/cmd/DeleteShapeHandler'),
|
DeleteShapeHandler = require('diagram-js/lib/features/modeling/cmd/DeleteShapeHandler'),
|
||||||
MoveShapeHandler = require('diagram-js/lib/features/modeling/cmd/MoveShapeHandler'),
|
MoveShapeHandler = require('diagram-js/lib/features/modeling/cmd/MoveShapeHandler'),
|
||||||
|
|
||||||
AppendShapeHandler = require('./cmd/AppendShapeHandler'),
|
AppendShapeHandler = require('diagram-js/lib/features/modeling/cmd/AppendShapeHandler'),
|
||||||
|
|
||||||
CreateLabelHandler = require('diagram-js/lib/features/modeling/cmd/CreateLabelHandler'),
|
CreateLabelHandler = require('diagram-js/lib/features/modeling/cmd/CreateLabelHandler'),
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ Modeling.prototype.appendFlowNode = function(source, type, position) {
|
||||||
y: source.y + source.height / 2
|
y: source.y + source.height / 2
|
||||||
};
|
};
|
||||||
|
|
||||||
return this.appendShape(source, { type: type }, position, { type: 'bpmn:SequenceFlow'});
|
return this.appendShape(source, { type: type }, position, null, { attrs: { type: 'bpmn:SequenceFlow' } });
|
||||||
};
|
};
|
||||||
|
|
||||||
Modeling.prototype.appendTextAnnotation = function(source, type, position) {
|
Modeling.prototype.appendTextAnnotation = function(source, type, position) {
|
||||||
|
@ -80,5 +80,5 @@ Modeling.prototype.appendTextAnnotation = function(source, type, position) {
|
||||||
y: source.y - (source.height / 2) - 100
|
y: source.y - (source.height / 2) - 100
|
||||||
};
|
};
|
||||||
|
|
||||||
return this.appendShape(source, { type: type }, position, { type: 'bpmn:Association'});
|
return this.appendShape(source, { type: type }, position, null, { attrs: { type: 'bpmn:Association' } });
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var BaseAppendShapeHandler = require('diagram-js/lib/features/modeling/cmd/AppendShapeHandler');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A bpmn-aware append shape handler
|
|
||||||
*
|
|
||||||
* @param {canvas} Canvas
|
|
||||||
* @param {elementFactory} ElementFactory
|
|
||||||
* @param {modeling} Modeling
|
|
||||||
*/
|
|
||||||
function AppendShapeHandler(modeling) {
|
|
||||||
this._modeling = modeling;
|
|
||||||
}
|
|
||||||
|
|
||||||
AppendShapeHandler.prototype = Object.create(BaseAppendShapeHandler.prototype);
|
|
||||||
|
|
||||||
module.exports = AppendShapeHandler;
|
|
||||||
|
|
||||||
AppendShapeHandler.$inject = [ 'modeling' ];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
AppendShapeHandler.prototype.postExecute = function(context) {
|
|
||||||
|
|
||||||
this._modeling.createConnection(
|
|
||||||
context.source,
|
|
||||||
context.shape,
|
|
||||||
{
|
|
||||||
type: context.connection.type
|
|
||||||
},
|
|
||||||
context.source.parent);
|
|
||||||
};
|
|
Loading…
Reference in New Issue