From 2c5548423b45ee7a8c669367ec263f2a1194123b Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Thu, 28 Aug 2014 17:38:51 +0200 Subject: [PATCH] chore(modeling): remove custom shape.append handler --- lib/features/modeling/Modeling.js | 6 ++-- .../modeling/cmd/AppendShapeHandler.js | 33 ------------------- 2 files changed, 3 insertions(+), 36 deletions(-) delete mode 100644 lib/features/modeling/cmd/AppendShapeHandler.js diff --git a/lib/features/modeling/Modeling.js b/lib/features/modeling/Modeling.js index e6b8161e..d09d0b40 100644 --- a/lib/features/modeling/Modeling.js +++ b/lib/features/modeling/Modeling.js @@ -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' } }); }; diff --git a/lib/features/modeling/cmd/AppendShapeHandler.js b/lib/features/modeling/cmd/AppendShapeHandler.js deleted file mode 100644 index 48fe6bc0..00000000 --- a/lib/features/modeling/cmd/AppendShapeHandler.js +++ /dev/null @@ -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); -}; \ No newline at end of file