From a69d70c8742ee27208efcf30154dcfaddc7ae22c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 10 Jan 2018 23:10:29 +0100 Subject: [PATCH] Add `component:clone` event. Closes #739 --- src/commands/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/index.js b/src/commands/index.js index aa7ab7b5f..d8cda886a 100644 --- a/src/commands/index.js +++ b/src/commands/index.js @@ -138,8 +138,9 @@ module.exports = () => { var collection = sel.collection; var index = collection.indexOf(sel); - collection.add(sel.clone(), {at: index + 1}); - sel.emitUpdate() + const added = collection.add(sel.clone(), {at: index + 1}); + sel.emitUpdate(); + ed.trigger('component:clone', added); }, };