chore(modeling): remove custom shape.append handler

This commit is contained in:
Nico Rehwaldt 2014-08-28 17:38:51 +02:00
parent a301acc4c4
commit 2c5548423b
2 changed files with 3 additions and 36 deletions

View File

@ -8,7 +8,7 @@ var CreateShapeHandler = require('diagram-js/lib/features/modeling/cmd/CreateSha
DeleteShapeHandler = require('diagram-js/lib/features/modeling/cmd/DeleteShapeHandler'),
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'),
@ -70,7 +70,7 @@ Modeling.prototype.appendFlowNode = function(source, type, position) {
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) {
@ -80,5 +80,5 @@ Modeling.prototype.appendTextAnnotation = function(source, type, position) {
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' } });
};

View File

@ -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);
};