fix(copy-paste): emit <moddleCopy.canSetCopiedProperty> with existing property
This commit is contained in:
parent
f5861dfade
commit
707257e020
|
@ -164,7 +164,7 @@ ModdleCopy.prototype.copyElement = function(sourceElement, targetElement, proper
|
|||
var copiedProperty = self.copyProperty(sourceProperty, targetElement, propertyName);
|
||||
|
||||
var canSetProperty = self._eventBus.fire('moddleCopy.canSetCopiedProperty', {
|
||||
parent: parent,
|
||||
parent: targetElement,
|
||||
property: copiedProperty,
|
||||
propertyName: propertyName
|
||||
});
|
||||
|
|
|
@ -607,6 +607,12 @@ describe('features/copy-paste/ModdleCopy', function() {
|
|||
});
|
||||
|
||||
eventBus.on('moddleCopy.canCopyProperty', HIGH_PRIORITY, function(context) {
|
||||
|
||||
// verify provided properties
|
||||
expect(context).to.have.property('parent');
|
||||
expect(context).to.have.property('property');
|
||||
expect(context).to.have.property('propertyName');
|
||||
|
||||
var propertyName = context.propertyName;
|
||||
|
||||
if (propertyName === 'name') {
|
||||
|
@ -630,6 +636,12 @@ describe('features/copy-paste/ModdleCopy', function() {
|
|||
});
|
||||
|
||||
eventBus.on('moddleCopy.canSetCopiedProperty', HIGH_PRIORITY, function(context) {
|
||||
|
||||
// verify provided properties
|
||||
expect(context).to.have.property('parent');
|
||||
expect(context).to.have.property('property');
|
||||
expect(context).to.have.property('propertyName');
|
||||
|
||||
var property = context.property;
|
||||
|
||||
if (property === 'foo') {
|
||||
|
|
Loading…
Reference in New Issue