Browse Source

Propogate old commands events

pull/2062/head
Artur Arseniev 7 years ago
parent
commit
0178b9812e
  1. 10
      src/commands/index.js

10
src/commands/index.js

@ -177,7 +177,15 @@ module.exports = () => {
const cmd = require(`./view/${item[1]}`);
const cmdName = `core:${item[0]}`;
defaultCommands[cmdName] = cmd;
if (oldCmd) defaultCommands[oldCmd] = cmd;
if (oldCmd) {
defaultCommands[oldCmd] = cmd;
// Propogate old commands (can be removed once we stop to call old commands)
['run', 'stop'].forEach(name => {
em.on(`${name}:${oldCmd}`, (...args) =>
em.trigger(`${name}:${cmdName}`, ...args)
);
});
}
});
if (c.em) c.model = c.em.get('Canvas');

Loading…
Cancel
Save