|
@@ -16,17 +16,21 @@ import { browser } from "../../../application/browser";
|
|
|
|
|
|
export class ActionManager {
|
|
|
|
|
|
+ // @calledby app/core/drawers/layer.js: constructor(id, konvaLayer): this.actionManager = new ActionManager();
|
|
|
constructor () {
|
|
|
+ console.log("action-manager.js!constructor()"); //D console.trace();
|
|
|
this.actions = [];
|
|
|
}
|
|
|
|
|
|
push (action) {
|
|
|
- this.actions.push(action);
|
|
|
+ console.log("action-manager.js!push(action): action=" + JSON.stringify(action));
|
|
|
+ this.actions.push(action); // "action" is JSON like: {"id":2,"type":0,"definition":... ,"elementClass":0}
|
|
|
}
|
|
|
|
|
|
remove (genericObject) {
|
|
|
const action = this.actions.find(action => action.genericObject == genericObject);
|
|
|
const index = this.actions.indexOf(action);
|
|
|
+ console.log("action-manager.js!remove(genericObject): action=" + action + ", index=" + index);
|
|
|
this.actions.splice(index, 1);
|
|
|
}
|
|
|
|
|
@@ -35,10 +39,12 @@ export class ActionManager {
|
|
|
}
|
|
|
|
|
|
clear () {
|
|
|
+ console.log("action-manager.js!clear()");
|
|
|
this.actions = [];
|
|
|
}
|
|
|
|
|
|
load (actions) {
|
|
|
+ console.log("action-manager.js!load(actions)");
|
|
|
this.actions = actions;
|
|
|
}
|
|
|
|