chore(modeling): minor SetColorHandler cleanup

This commit is contained in:
Nico Rehwaldt 2018-01-31 12:07:44 +01:00
parent 953574eefb
commit 3124f9ba96
1 changed files with 14 additions and 9 deletions

View File

@ -3,19 +3,27 @@
var assign = require('lodash/object/assign'),
forEach = require('lodash/collection/forEach');
var DEFAULT_COLORS = {
fill: undefined,
stroke: undefined
};
function SetColorHandler(commandStack) {
this._commandStack = commandStack;
}
SetColorHandler.$inject = [ 'commandStack' ];
SetColorHandler.$inject = [
'commandStack'
];
module.exports = SetColorHandler;
SetColorHandler.prototype.postExecute = function(context) {
var elements = context.elements,
colors = context.colors || { fill: undefined, stroke: undefined };
colors = context.colors || DEFAULT_COLORS;
var that = this;
var self = this;
var di = {};
@ -28,7 +36,8 @@ SetColorHandler.prototype.postExecute = function(context) {
}
forEach(elements, function(element) {
that._commandStack.execute('element.updateProperties', {
self._commandStack.execute('element.updateProperties', {
element: element,
properties: {
di: di
@ -36,8 +45,4 @@ SetColorHandler.prototype.postExecute = function(context) {
});
});
};
SetColorHandler.prototype.execute = function(context) {};
SetColorHandler.prototype.revert = function(context) {};
};