mirror of https://github.com/artf/grapesjs.git
2 changed files with 11 additions and 3 deletions
@ -1,14 +1,17 @@ |
|||
import Component from '../../dom_components/model/Component'; |
|||
import { CustomCommand } from './CommandAbstract'; |
|||
|
|||
export default { |
|||
run(ed) { |
|||
if (!ed.Canvas.hasFocus()) return; |
|||
const toSelect = []; |
|||
const toSelect: Component[] = []; |
|||
|
|||
ed.getSelectedAll().forEach(component => { |
|||
const coll = component.components(); |
|||
const next = coll && coll.filter(c => c.get('selectable'))[0]; |
|||
const next = coll && coll.filter((c: any) => c.get('selectable'))[0]; |
|||
next && toSelect.push(next); |
|||
}); |
|||
|
|||
toSelect.length && ed.select(toSelect); |
|||
}, |
|||
}; |
|||
} as CustomCommand; |
|||
Loading…
Reference in new issue