mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-02-02 12:13:42 +00:00
chore(modeling): minor SetColorHandler cleanup
This commit is contained in:
parent
953574eefb
commit
3124f9ba96
@ -3,19 +3,27 @@
|
|||||||
var assign = require('lodash/object/assign'),
|
var assign = require('lodash/object/assign'),
|
||||||
forEach = require('lodash/collection/forEach');
|
forEach = require('lodash/collection/forEach');
|
||||||
|
|
||||||
|
var DEFAULT_COLORS = {
|
||||||
|
fill: undefined,
|
||||||
|
stroke: undefined
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
function SetColorHandler(commandStack) {
|
function SetColorHandler(commandStack) {
|
||||||
this._commandStack = commandStack;
|
this._commandStack = commandStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetColorHandler.$inject = [ 'commandStack' ];
|
SetColorHandler.$inject = [
|
||||||
|
'commandStack'
|
||||||
|
];
|
||||||
|
|
||||||
module.exports = SetColorHandler;
|
module.exports = SetColorHandler;
|
||||||
|
|
||||||
SetColorHandler.prototype.postExecute = function(context) {
|
SetColorHandler.prototype.postExecute = function(context) {
|
||||||
var elements = context.elements,
|
var elements = context.elements,
|
||||||
colors = context.colors || { fill: undefined, stroke: undefined };
|
colors = context.colors || DEFAULT_COLORS;
|
||||||
|
|
||||||
var that = this;
|
var self = this;
|
||||||
|
|
||||||
var di = {};
|
var di = {};
|
||||||
|
|
||||||
@ -28,7 +36,8 @@ SetColorHandler.prototype.postExecute = function(context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
forEach(elements, function(element) {
|
forEach(elements, function(element) {
|
||||||
that._commandStack.execute('element.updateProperties', {
|
|
||||||
|
self._commandStack.execute('element.updateProperties', {
|
||||||
element: element,
|
element: element,
|
||||||
properties: {
|
properties: {
|
||||||
di: di
|
di: di
|
||||||
@ -36,8 +45,4 @@ SetColorHandler.prototype.postExecute = function(context) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
SetColorHandler.prototype.execute = function(context) {};
|
|
||||||
|
|
||||||
SetColorHandler.prototype.revert = function(context) {};
|
|
Loading…
x
Reference in New Issue
Block a user